/* ===== Tema KLOUSEN «vivo»: claro, colores vivos, esquinas redondeadas (se carga al final) ===== */
:root, :root:not([data-theme="dark"]) {
  color-scheme: light;
  --bg: #f5f7fc; --bg-alt: #eef1f8; --surface: #ffffff; --text: #1b1f3b; --muted: #646b8a; --border: #e3e7f1;
  --primary: #ff2d78; --primary-hover: #ec1c68; --primary-soft: #ffe6ef;
  --accent: #7c4dff; --accent-2: #00b4d8; --ok: #12b76a; --warn: #f59e0b; --danger: #ef4444;
  --grad: linear-gradient(135deg, #ff2d78 0%, #a24bff 100%);
  --grad-hero: linear-gradient(130deg, #2b2f8f 0%, #6a3cf0 50%, #ff2d78 100%);
  --ink: #232764; --chart-ink: #3a3f78;
  --shadow: 0 18px 40px -22px rgba(35, 39, 100, .35);
  --card-shadow: 0 1px 2px rgba(35, 39, 100, .06), 0 8px 24px -16px rgba(35, 39, 100, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: light;
    --bg: #f5f7fc; --bg-alt: #eef1f8; --surface: #ffffff; --text: #1b1f3b; --muted: #646b8a; --border: #e3e7f1;
    --primary: #ff2d78; --primary-hover: #ec1c68; --primary-soft: #ffe6ef; --chart-ink: #3a3f78;
    --danger: #ef4444; --ok: #12b76a;
  }
}
/* Modo oscuro opcional (◐): azul marino suave, no negro */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171b36; --bg-alt: #1e2345; --surface: #242a52; --text: #eef0fb; --muted: #a7add0; --border: #343b6b;
  --primary: #ff4d8d; --primary-hover: #ff6a9f; --primary-soft: #4a2147; --chart-ink: #cfd3f5;
  --danger: #ff6b6b; --ok: #34d399;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, .55);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 26px -18px rgba(0, 0, 0, .6);
}

/* --- Botones tipo píldora, con degradé --- */
.btn { border-radius: 999px; }
.btn-primary, .btn-primary.btn-xs, .btn-primary.btn-lg, .auth-molly {
  clip-path: none; border-radius: 999px; background: var(--grad); color: #fff; border: 0;
  box-shadow: 0 8px 20px -10px rgba(255, 45, 120, .7);
}
.btn-primary:hover { background: var(--grad); filter: brightness(1.06); transform: translateY(-1px); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-ghost { border: 1px solid var(--border); background: var(--surface); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-danger { background: rgba(239, 68, 68, .1); color: var(--danger); }
.btn-lg { text-transform: none; letter-spacing: 0; }
.logo { clip-path: none; border-radius: 10px; background: var(--grad); }
.theme-toggle { border-radius: 999px; background: var(--surface); }

/* --- Campos --- */
.input, .select { border-radius: 10px; background: var(--surface); }
.input:focus, .select:focus { outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent); }

/* --- Menú lateral claro --- */
.sidebar { background: var(--surface); border-right: 1px solid var(--border); box-shadow: 2px 0 18px -14px rgba(35, 39, 100, .3); }
.sidebar .brand { color: var(--text); }
.sidebar .ws-name { color: #9aa0bf; font-weight: 700; }
.sidebar .side-btn { color: #4b5178; border-radius: 10px; }
.sidebar .side-btn:hover { background: var(--bg-alt); color: var(--text); }
.sidebar .side-btn.active { background: var(--grad); color: #fff; clip-path: none; border-radius: 10px; box-shadow: 0 8px 18px -10px rgba(162, 75, 255, .8); }
.sidebar .side-btn .count { background: var(--bg-alt); color: var(--muted); }
.sidebar .side-btn.active .count { background: rgba(255, 255, 255, .25); color: #fff; }
.sidebar .count.unread { background: var(--primary); color: #fff; }
.sidebar .side-foot, .sidebar .me { border-color: var(--border); }
.sidebar .me-info b { color: var(--text); }
.sidebar .me-info small { color: var(--muted); }
.sidebar .icon-btn { color: var(--muted); }
.sidebar .icon-btn:hover { background: var(--bg-alt); color: var(--text); }
.side-more[open] summary { color: var(--text); }
.side-molly { background: var(--grad); border: 0; box-shadow: 0 12px 26px -14px rgba(162, 75, 255, .9); }
:root[data-theme="dark"] .sidebar .side-btn { color: #c3c7e6; }
:root[data-theme="dark"] .sidebar .ws-name { color: #7f86b3; }

/* --- Barra superior --- */
.topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom-color: var(--border); }

/* --- Tarjetas con sombra suave --- */
.stat, .panel, .tcard, .pcard, .meet-card, .est-box, .pd-sec.track, .team-chip, .act-item, .note-item, .chart-card, .kpi-card, .vault-wrap, .table-wrap {
  border-radius: 14px;
}
.stat, .panel, .tcard, .pcard, .meet-card, .chart-card { background: var(--surface); box-shadow: var(--card-shadow); border-color: var(--border); }
.tcard:hover, .pcard:hover { border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); box-shadow: 0 14px 30px -18px rgba(255, 45, 120, .55); }
.kcol { background: var(--bg-alt); border-radius: 16px; }
dialog { border-radius: 18px; border: 1px solid var(--border); box-shadow: 0 30px 80px -30px rgba(35, 39, 100, .55); }

/* Indicadores con un color vivo cada uno */
.stats .stat, .kpis .stat { position: relative; overflow: hidden; border-left: 0; }
.stats .stat::before, .kpis .stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--primary)); }
.stats .stat:nth-child(6n+1), .kpis .stat:nth-child(6n+1) { --c: #ff2d78; }
.stats .stat:nth-child(6n+2), .kpis .stat:nth-child(6n+2) { --c: #7c4dff; }
.stats .stat:nth-child(6n+3), .kpis .stat:nth-child(6n+3) { --c: #00b4d8; }
.stats .stat:nth-child(6n+4), .kpis .stat:nth-child(6n+4) { --c: #12b76a; }
.stats .stat:nth-child(6n+5), .kpis .stat:nth-child(6n+5) { --c: #f59e0b; }
.stats .stat:nth-child(6n+6), .kpis .stat:nth-child(6n+6) { --c: #3b82f6; }
.stat.warn b { color: var(--danger); }
.stat.ok b { color: var(--ok); }

/* Columnas del tablero con su color */
.kcol[data-status="todo"] .kcol-head { border-bottom: 3px solid #7c4dff; padding-bottom: 6px; }
.kcol[data-status="doing"] .kcol-head { border-bottom: 3px solid #f59e0b; padding-bottom: 6px; }
.kcol[data-status="done"] .kcol-head { border-bottom: 3px solid #12b76a; padding-bottom: 6px; }

/* Pestañas segmentadas */
.seg { border-radius: 999px; background: var(--bg-alt); border-color: transparent; padding: 3px; }
.seg button { border-radius: 999px; }
.seg button.active { background: var(--surface); color: var(--primary); box-shadow: 0 2px 8px -3px rgba(35, 39, 100, .35); }

/* Etiquetas de prioridad y estados más vivos */
.prio.p-alta { background: #ffe4e6; color: #e11d48; }
.prio.p-media { background: #fff3d6; color: #b7791f; }
.prio.p-baja { background: #dcfce7; color: #15803d; }
:root[data-theme="dark"] .prio.p-alta { background: #4c1d2b; color: #fda4af; }
:root[data-theme="dark"] .prio.p-media { background: #48391a; color: #fcd34d; }
:root[data-theme="dark"] .prio.p-baja { background: #163f2c; color: #86efac; }

/* --- Página de inicio y login: portada con degradé vivo en vez de negro --- */
.nav { background: color-mix(in srgb, var(--surface) 88%, transparent); }
.nav .brand, .nav .btn-ghost, .nav .theme-toggle, .nav .menu-btn { color: var(--text); }
.nav .theme-toggle, .nav .menu-btn { border-color: var(--border); }
.nav-links a { color: var(--muted); text-transform: none; font-size: .92rem; font-weight: 600; letter-spacing: 0; }
.nav-links a:hover { background: var(--bg-alt); color: var(--text); }
.nav.scrolled { border-color: var(--border); }
.hero { background: var(--grad-hero); }
.hero::before { background: rgba(255, 255, 255, .07); }
.hero::after { background: rgba(255, 255, 255, .12); }
.hero h1 { text-transform: none; }
/* Video corporativo de fondo: sutil, teñido con el degradado y desvanecido hacia el mockup */
.hero-media { position: absolute; inset: 0 0 auto 0; height: 760px; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.hero-video { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .45; filter: saturate(.7) blur(1px); }
.hero-media::after { content: ""; position: absolute; inset: 0; background: var(--grad-hero); opacity: .72; }
@media (prefers-reduced-motion: reduce), (max-width: 640px) { .hero-media { display: none; } }
.section h2, .ai h2, .auth-pitch h1 { text-transform: none; }
.auth-brand { background: var(--grad-hero); }
.auth-brand::before { background: rgba(255, 255, 255, .12); }
.ai { background: linear-gradient(140deg, #232764 0%, #4b2fc2 60%, #c42f9a 100%); }

/* --- Fondo personalizable (Personalizar) --- */
body.app { position: relative; isolation: isolate; }
body.app::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--app-bg, none); opacity: var(--app-bg-op, .7); }
.pz h4 { margin: 14px 0 8px; font-size: .9rem; }
.pz h4:first-child { margin-top: 0; }
.pz-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pz-bg { display: grid; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--text); text-align: center; }
.pz-bg span { display: grid; place-items: center; height: 64px; border-radius: 12px; border: 2px solid var(--border); background-color: var(--bg) !important; font-size: 1.3rem; color: var(--muted); }
.pz-bg.on span { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pz-bg small { font-size: .74rem; color: var(--muted); }
.pz-upload { margin-top: 10px; cursor: pointer; }
.pz-range { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: .84rem; color: var(--muted); }
.pz-range input { flex: 1; accent-color: var(--primary); }
.pz-pals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pz-pal { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .82rem; cursor: pointer; }
.pz-pal i { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.pz-pal.on { border-color: var(--primary); }
.pz-mode { display: inline-flex; }
@media (max-width: 600px) { .pz-grid { grid-template-columns: repeat(2, 1fr); } .pz-pals { grid-template-columns: 1fr 1fr; } }
/* --- Lynx como bot (Recall.ai) --- */
.meet-link { width: 100%; margin-top: 8px; }
.bot-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft); margin: 8px 0 10px; }
.bot-bar > div { display: grid; gap: 2px; }
.bot-bar small { color: var(--muted); font-size: .78rem; }
.bot-bar a { color: var(--primary); font-weight: 600; }
.bot-bar.st-in_call_recording b { color: #e11d48; }
.bot-bar.st-fatal, .bot-bar.st-recording_permission_denied { background: rgba(239, 68, 68, .12); }
.bot-bar.st-done { background: rgba(18, 183, 106, .12); }
.tag.bot-st { background: var(--primary-soft); color: var(--primary); border-color: transparent; font-weight: 600; }
.tag.bot-st.st-in_call_recording { background: #ffe4e6; color: #e11d48; }
.tag.bot-st.st-fatal { background: rgba(239, 68, 68, .12); color: var(--danger); }
#meetVideoBox { margin: 4px 0 10px; }
.meet-video { width: 100%; max-height: 420px; border-radius: 12px; background: #000; }
/* --- Outlook --- */
.pref-title { margin: 18px 0 8px; font-size: 1.05rem; }
.copy-row { display: flex; gap: 6px; }
.copy-row .input { flex: 1; min-width: 0; font-size: .8rem; }
.ol-mine { margin-bottom: 14px; }
.ol-line { margin: 4px 0 10px; font-size: .88rem; }
.cal-chip.c-outlook { background: #e0ecff; color: #1d4ed8; }
:root[data-theme="dark"] .cal-chip.c-outlook { background: #1e3a6e; color: #bfdbfe; }
.ol-hint { margin-left: 4px; }
.assigned-by { margin: -4px 0 10px; font-size: .84rem; color: var(--muted); }
.assigned-by b { color: var(--text); }
#taskForm .input.fixed { background: var(--bg-alt); color: var(--text); cursor: not-allowed; border-style: dashed; }
#listBody tr.row-open > td { background: var(--primary-soft); border-bottom: 0; }
#listBody tr.row-open > td:first-child { box-shadow: inset 4px 0 0 var(--primary); }
#listBody tr.brief-row > td { padding: 0 14px 18px; background: var(--primary-soft); border-bottom: 1px solid var(--border); }
.brief-card { background: var(--surface); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); border-left: 4px solid var(--primary); border-radius: 14px; padding: 14px 18px 10px; box-shadow: 0 12px 28px -18px rgba(35, 39, 100, .45); }
.brief-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px dashed var(--border); font-size: .84rem; color: var(--muted); }
.brief-card-head b { color: var(--text); }
.brief-card-foot { display: flex; justify-content: center; border-top: 1px dashed var(--border); margin-top: 12px; padding-top: 8px; }
.brief-card-foot .link-btn { margin: 0; }
.brief-card .brief-thread { margin-top: 14px; }
.tcard .t-owner { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); max-width: 170px; }
.tcard .t-owner > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--text); }
.tcard .t-unassigned { font-size: .74rem; font-weight: 700; color: #b45309; background: #fef3c7; border: 1px dashed #f59e0b; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
:root[data-theme="dark"] .tcard .t-unassigned { color: #fcd34d; background: #48391a; }
.tcard.is-ticket { border-left: 4px solid #16a34a; background: linear-gradient(90deg, rgba(22, 163, 74, .07), var(--surface) 38%); }
.tcard-ticket { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: -2px 0 8px; }
.ticket-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; color: #15803d; background: #dcfce7; border: 1px solid #86efac; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.ticket-link { font-weight: 700; color: #15803d; text-decoration: none; padding: 0 6px; border-radius: 6px; }
.ticket-link:hover { background: #dcfce7; }
#listBody tr.is-ticket > td:first-child { box-shadow: inset 4px 0 0 #16a34a; }
#listBody .ticket-badge { margin-right: 4px; vertical-align: 1px; }
:root[data-theme="dark"] .ticket-badge { color: #86efac; background: #14532d; border-color: #166534; }
:root[data-theme="dark"] .tcard.is-ticket { background: linear-gradient(90deg, rgba(34, 197, 94, .12), var(--surface) 38%); }







.origin-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.ochip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .8rem; cursor: pointer; }
.ochip b { font-size: .72rem; color: var(--muted); }
.ochip b:empty { display: none; }
.ochip:hover { border-color: var(--primary); }
.ochip.on { background: var(--grad); color: #fff; border-color: transparent; }
.ochip.on b { color: rgba(255, 255, 255, .85); }
.ochip.fd { border-color: #86efac; color: #15803d; background: #f0fdf4; }
.ochip.fd.on { background: #16a34a; color: #fff; border-color: #16a34a; }
:root[data-theme="dark"] .ochip.fd { background: #14532d; color: #86efac; border-color: #166534; }
.side-ext { text-decoration: none; }
.side-ext .ext { margin-left: auto; font-size: .8rem; opacity: .6; }
.ticketera-btn { margin-left: auto; color: #15803d; border-color: #86efac; text-decoration: none; }
.ticketera-btn:hover { background: #f0fdf4; }
:root[data-theme="dark"] .ticketera-btn { color: #86efac; border-color: #166534; }
.ticket-people { margin: 4px 0 6px; font-size: .76rem; color: var(--muted); line-height: 1.5; }
.ticket-people b { color: var(--text); font-weight: 600; }
.ticket-people b.late { color: #b45309; }
.tcard .t-unassigned.outside { color: #15803d; background: #f0fdf4; border-color: #86efac; }

.stat.stat-filter { font: inherit; text-align: left; cursor: pointer; color: var(--text); transition: transform .12s, box-shadow .12s; }
.stat.stat-filter:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -18px rgba(35, 39, 100, .5); }
.stat.stat-filter.on { outline: 2px solid var(--c, var(--primary)); outline-offset: -2px; background: color-mix(in srgb, var(--c, var(--primary)) 8%, var(--surface)); }
.stat.stat-filter.on span { color: var(--text); font-weight: 600; }
.stats .stat:nth-child(1) { --c: #ff2d78; } .stats .stat:nth-child(2) { --c: #7c4dff; } .stats .stat:nth-child(3) { --c: #00b4d8; } .stats .stat:nth-child(4) { --c: #12b76a; }
.hint.filtering { background: var(--primary-soft); color: var(--text); border-radius: 10px; padding: 6px 12px; display: inline-block; }
.hint.filtering .link-btn { margin: 0 0 0 4px; }

.tag.archived-tag { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; font-weight: 600; }
:root[data-theme="dark"] .tag.archived-tag { background: #312e81; color: #c7d2fe; border-color: #3730a3; }

.ticket-open { font-size: .74rem; font-weight: 700; color: #15803d; text-decoration: none; border: 1px solid #86efac; border-radius: 999px; padding: 1px 8px; margin: 0 4px 0 2px; white-space: nowrap; }
.ticket-open:hover { background: #dcfce7; }
.brief-card-head .ticketera-btn { margin-left: 0; }
:root[data-theme="dark"] .ticket-open { color: #86efac; border-color: #166534; }

.fd-detail { margin-top: 12px; border: 1px solid #bbf7d0; border-left: 4px solid #16a34a; background: #f7fef9; border-radius: 12px; padding: 10px 14px; }
.fd-detail h5 { margin: 0 0 6px; font-size: .82rem; color: #15803d; }
.fd-detail-text { white-space: pre-wrap; font-size: .86rem; margin: 0; max-height: 320px; overflow: auto; }
.fd-files { margin: -4px 0 12px; }
.fd-files small { color: var(--muted); font-size: .76rem; }
.fd-detail .att-imgs img, .fd-files .att-imgs img { width: 180px; height: 120px; }
:root[data-theme="dark"] .fd-detail { background: #10261a; border-color: #166534; }
dialog.lightbox { width: min(1200px, 100vw - 32px); max-width: none; height: min(90vh, 900px); padding: 0; border: 0; border-radius: 16px; background: #0f1226; overflow: hidden; }
dialog.lightbox::backdrop { background: rgba(10, 12, 30, .75); }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: #171b36; color: #eef0fb; }
.lb-name { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar .btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .18); text-decoration: none; }
.lb-stage { height: calc(100% - 52px); display: grid; place-items: center; padding: 12px; overflow: auto; cursor: zoom-out; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; background: #fff; cursor: default; }
.fd-send { font-size: .8rem; color: #15803d; }
.fd-note-st { display: inline-block; margin-top: 4px; font-size: .72rem; color: var(--muted); }
.fd-note-st.ok { color: #15803d; }
.fd-note-st.err { color: var(--danger); cursor: help; }
.ticket-hours { margin: 12px 0; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--surface); }
.th-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.th-head h5 { margin: 0; font-size: .86rem; }
.th-total { font-size: .82rem; color: var(--muted); }
.th-total b { color: var(--text); font-size: .95rem; }
.th-list { display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.th-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: start; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: .82rem; }
.th-row > b { font-variant-numeric: tabular-nums; font-size: .95rem; }
.th-row small { display: block; color: var(--muted); }
.th-bill { font-size: .68rem; border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; margin-left: 4px; color: var(--muted); }
.th-st { white-space: nowrap; font-size: .72rem; color: var(--muted); }
.th-st.ok { color: #15803d; }
.th-st.err { color: var(--danger); cursor: help; }
.th-form { display: grid; grid-template-columns: 140px 100px 1fr auto auto auto; gap: 6px; align-items: end; margin-top: 10px; }
.th-form label { display: grid; gap: 3px; font-size: .74rem; color: var(--muted); font-weight: 600; }
.th-form label.check { display: flex; font-weight: 500; white-space: nowrap; padding-bottom: 6px; }
.th-form .input.xs { width: 100% !important; height: 32px; }
@media (max-width: 760px) { .th-form { grid-template-columns: 1fr 1fr; } .th-form .th-note { grid-column: 1 / -1; } }
.th-hint { margin: 8px 0 0; font-size: .74rem; }

.g-chart { position: relative; }
.g-line .g-track { background: color-mix(in srgb, var(--pc, #888) 5%, var(--bg-alt)); }
.g-line.item .g-track { background: transparent; }
.g-mline { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--text) 9%, transparent); }
.g-today { width: 2px; background: #ef4444; opacity: .9; box-shadow: 0 0 0 2px rgba(239, 68, 68, .12); }
.g-today-tag { position: absolute; top: 0; transform: translateX(-50%); font-size: .62rem; font-weight: 800; color: #fff; background: #ef4444; border-radius: 999px; padding: 1px 6px; z-index: 2; }
.g-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--pc); margin-right: 6px; vertical-align: -1px; }
.g-line.phase .g-label { color: var(--text); }
.g-bar { background: color-mix(in srgb, var(--pc) 18%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--pc) 70%, transparent); border-radius: 6px; overflow: hidden; }
.g-bar i { background: var(--pc); border-radius: 0; }
.g-bar.g-pendiente { border-style: dashed; background: color-mix(in srgb, var(--pc) 10%, var(--surface)); }
.g-bar.g-en_curso i { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .28) 0 6px, transparent 6px 12px); background-color: var(--pc); }
.g-bar.g-listo { background: var(--pc); border-color: var(--pc); }
.g-bar em { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); font-size: .68rem; }
.g-bar.g-pendiente em { color: color-mix(in srgb, var(--pc) 80%, var(--text)); text-shadow: none; }
.g-line.late .g-bar, .g-bar.is-late { outline: 2px solid #ef4444; outline-offset: 1px; }
.g-line.late .g-label { color: #ef4444; }
.g-bar.thin { border-width: 1px; }
.g-grid.phase { box-shadow: inset 4px 0 0 var(--pc); border-radius: 6px; padding-left: 6px; }
.g-grid.item { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--pc) 55%, transparent); padding-left: 6px; }
.g-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; font-size: .78rem; color: var(--muted); }
.g-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.g-legend small { flex-basis: 100%; }
.lg { display: inline-block; width: 26px; height: 10px; border-radius: 3px; --pc: #7c4dff; }
.lg-pend { border: 1.5px dashed var(--pc); background: color-mix(in srgb, var(--pc) 10%, transparent); }
.lg-curso { background: linear-gradient(90deg, var(--pc) 55%, color-mix(in srgb, var(--pc) 18%, transparent) 55%); border: 1.5px solid var(--pc); }
.lg-listo { background: var(--pc); }
.lg-late { background: color-mix(in srgb, var(--pc) 18%, transparent); outline: 2px solid #ef4444; }
.lg-hoy { width: 3px; height: 14px; background: #ef4444; }
.g-bar.g-en_curso { background: color-mix(in srgb, var(--pc) 18%, var(--surface)); }
.g-bar.g-listo, .g-bar.g-listo i { background: var(--pc); }
.g-bar.g-en_curso em, .g-bar.g-pendiente em { color: var(--text); text-shadow: none; background: color-mix(in srgb, var(--surface) 88%, transparent); border-radius: 4px; padding: 0 4px; top: 2px; line-height: 1.35; }

.main { padding: 0 40px 48px; }
/* La franja de la barra superior ocupa todo el ancho; el título queda con margen DENTRO de ella */
.topbar { padding: 22px 40px 18px; margin: 0 -40px; }
.topbar h1 { font-size: 1.45rem; }
.panel { padding: 18px 22px; }
.panel-head { margin-bottom: 12px; }
.stat { padding: 14px 18px; }
.dlg-form, .pd, .meet-detail { padding: 26px 30px; }
@media (max-width: 900px) { .main { padding: 0 18px 40px; } .topbar { padding: 16px 18px 14px; margin: 0 -18px; } .dlg-form, .pd, .meet-detail { padding: 20px 18px; } }
.pz-sound { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.arch-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.arch-bar .hint { margin: 0; }
.arch-bar .input { width: min(380px, 100%); }
#archiveBody tr.row-open > td { background: var(--primary-soft); }
#archiveBody tr.brief-row > td { padding: 0 14px 18px; background: var(--primary-soft); }
.hist-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid #12b76a; border-radius: 14px; padding: 14px 18px; box-shadow: var(--card-shadow); }
.hist-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px dashed var(--border); font-size: .84rem; color: var(--muted); }
.hist-head b { color: var(--text); }
.hist-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hist-grid > div { background: var(--bg-alt); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; }
.hist-grid small { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.hist-grid b { font-size: .84rem; font-weight: 600; }
.hist-card h5 { margin: 14px 0 6px; font-size: .84rem; }
.hist-tags { margin: 10px 0 0; }
.hist-desc { white-space: pre-wrap; font-size: .84rem; margin: 0; max-height: 220px; overflow: auto; background: var(--bg-alt); border-radius: 8px; padding: 8px 10px; }
.hist-notes { display: grid; gap: 6px; }
.hist-note { border-left: 3px solid var(--primary); padding: 4px 10px; }
.hist-note small { color: var(--muted); font-size: .74rem; }
.hist-note p { margin: 2px 0 0; font-size: .86rem; white-space: pre-wrap; }
.hist-timeline { margin: 0; padding-left: 18px; font-size: .8rem; display: grid; gap: 3px; }
.hist-timeline small { color: var(--muted); margin-right: 6px; }
@media (max-width: 900px) { .hist-grid { grid-template-columns: 1fr 1fr; } }
.deal-project { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; background: #fff7e6; border: 1px solid #fcd34d; font-size: .84rem; }
.deal-project.linked { background: #ecfdf3; border-color: #86efac; }
.deal-proj-tag { font-size: .68rem; font-weight: 700; color: #15803d; background: #dcfce7; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
.pv-origin { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: linear-gradient(90deg, #ecfdf3, var(--surface)); border: 1px solid #86efac; margin: 4px 0 8px; }
.pv-origin-ic { font-size: 1.4rem; }
.pv-origin > div { display: grid; gap: 2px; flex: 1; }
.pv-origin small { color: var(--muted); }
:root[data-theme="dark"] .deal-project { background: #3b2f12; border-color: #a16207; }
:root[data-theme="dark"] .deal-project.linked, :root[data-theme="dark"] .pv-origin { background: #10261a; border-color: #166534; }
.deal-view .deal-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 4px 0 6px; }
.ds-step { display: grid; justify-items: center; gap: 3px; position: relative; font-size: .76rem; color: var(--muted); }
.ds-step::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.ds-step:first-child::before { display: none; }
.ds-step i { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; background: var(--bg-alt); border: 2px solid var(--border); color: var(--muted); }
.ds-step.done i { background: #12b76a; border-color: #12b76a; color: #fff; }
.ds-step.done::before, .ds-step.now::before { background: #12b76a; }
.ds-step.now i { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 0 0 4px var(--primary-soft); }
.ds-step.now span { color: var(--text); font-weight: 700; }
.ds-step small { font-size: .66rem; }
.ds-lost { padding: 10px 14px; border-radius: 12px; background: rgba(239, 68, 68, .1); color: var(--danger); font-weight: 600; }
.deal-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.deal-kpis > div, .deal-view .pv-grid > div { background: var(--bg-alt); border-radius: 10px; padding: 8px 12px; display: grid; gap: 3px; }
.deal-kpis small, .deal-view .pv-grid > div > small { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.deal-kpis b { font-size: 1.05rem; }
.deal-view .pv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dw-add { grid-template-columns: minmax(200px, 320px) auto; justify-content: start; }
@media (max-width: 900px) { .deal-kpis, .deal-view .pv-grid { grid-template-columns: 1fr 1fr; } }
.molly-avatar, .molly-avatar.lg, .molly-avatar.sm, .molly-avatar.xs { border-radius: 50% !important; background: #fff !important; box-shadow: 0 0 0 1px rgba(28, 27, 25, .1), 0 4px 12px -6px rgba(63, 106, 168, .45); }
.molly-avatar img { width: 78%; height: 78%; margin: 0; }                /* logo de Lynx (PNG transparente) centrado sobre blanco */
.molly-avatar img { width: 100% !important; height: 100% !important; margin: 0 !important; object-fit: cover !important; border-radius: 50%; }
.molly-avatar.xs, .molly-avatar.sm { box-shadow: 0 0 0 1px rgba(0, 180, 216, .35); }
.deal-notes-ta { width: 100%; resize: vertical; margin-bottom: 8px; }
#dealNotes .row-btns small { align-self: center; }

.state-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; background: #fff7e6; border: 1px solid #fcd34d; font-size: .86rem; margin-top: 10px; }
.state-bar > span { display: grid; gap: 2px; }
.state-bar small { color: var(--muted); font-size: .76rem; }
.state-bar:not(.paused) { background: color-mix(in srgb, #7c4dff 8%, var(--surface)); border-color: color-mix(in srgb, #7c4dff 35%, transparent); }
:root[data-theme="dark"] .state-bar.paused { background: #3b2f12; border-color: #a16207; }
.dn-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin-bottom: 10px; }
.dn-add textarea { resize: vertical; min-height: 48px; }
.dn-list { display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.dn-item { border-left: 3px solid var(--primary); background: var(--bg-alt); border-radius: 0 10px 10px 0; padding: 6px 12px; }
.dn-item.first { border-left-color: var(--muted); }
.dn-item small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: .74rem; }
.dn-item small b { color: var(--text); }
.dn-item p { margin: 3px 0 0; font-size: .86rem; white-space: pre-wrap; }
.deal-prog { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin-top: 6px; width: 140px; }
.deal-prog i { height: 6px; border-radius: 3px; background: var(--border); }
.deal-prog.s0 i.on { background: #94a3b8; }
.deal-prog.s1 i.on { background: #3b82f6; }
.deal-prog.s2 i.on { background: #7c4dff; }
.deal-prog.s3 i.on { background: #f59e0b; }
.deal-prog.s4 i.on { background: #12b76a; }
.deal-prog.lost { grid-template-columns: 1fr; }
.deal-prog.lost i { background: #ef4444; opacity: .55; }
.cv-title { display: flex; align-items: center; gap: 12px; }
.cv-av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; font-size: 1rem; flex: none; }
.contact-view .mini-row > span:last-child { display: grid; justify-items: end; gap: 3px; }
.contact-view .deal-prog { width: 110px; margin-top: 0; }
.dn-actions { display: grid; gap: 4px; justify-items: center; }
.dn-actions small { font-size: .7rem; white-space: nowrap; }
.dn-actions small.unsaved { color: #d97706; font-weight: 600; }

/* Chat: alto fijo; solo la lista de mensajes se desplaza (la cabecera, los canales y el cuadro de escribir quedan fijos) */
.chat-layout { height: calc(100vh - 150px); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.chat-side { min-height: 0; overflow-y: auto; }
.chat-main { min-height: 0; overflow: hidden; }
.chat-head, .chat-compose { flex: none; }
.chat-msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 900px) { .chat-layout { height: auto; overflow: visible; } .chat-msgs { max-height: 60vh; } }
.dlg-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: -26px; z-index: 3; background: var(--surface); margin: -26px -30px 0; padding: 22px 30px 10px; }
.dlg-x { font-size: 1.05rem; }
#taskDialog { overflow-x: hidden; }
#taskDialog .th-form { grid-template-columns: 150px 110px 1fr; }
#taskDialog .th-form .th-note { grid-column: auto; }
#taskDialog .th-form label.check { padding-bottom: 0; }
#taskDialog .th-form [data-th-save] { justify-self: end; }
#listBody tr.pa-sep td { background: var(--bg-alt); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 14px; }
#listBody tr.is-project { cursor: pointer; }
#listBody tr.is-project > td:first-child { box-shadow: inset 4px 0 0 #7c4dff; }
.proj-badge { font-size: .7rem; font-weight: 700; color: #6d28d9; background: #ede9fe; border: 1px solid #c4b5fd; border-radius: 999px; padding: 1px 8px; margin-right: 4px; white-space: nowrap; }
:root[data-theme="dark"] .proj-badge { color: #c4b5fd; background: #2e1065; border-color: #5b21b6; }
.kpis .stat.stat-filter small { color: var(--muted); }
.kp-view { max-width: 100%; overflow-x: hidden; }
#genDialog:has(.kp-view) { width: min(720px, 92vw); overflow-x: hidden; }
.kp-list { display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.kp-row { background: var(--bg-alt); border-left: 3px solid var(--primary); border-radius: 0 10px 10px 0; padding: 8px 12px; display: grid; gap: 2px; }
.kp-row.late { border-left-color: #ef4444; }
.kp-row b { font-size: .9rem; }
.kp-row small { color: var(--muted); font-size: .76rem; }
.kp-row p { margin: 2px 0 0; font-size: .82rem; color: var(--text); white-space: pre-wrap; }
.retr-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg-alt); font-size: .84rem; margin: 4px 0 8px; }
.retr-bar > span { display: grid; gap: 2px; }

.pv-attn { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 14px; border-radius: 12px; background: #fff7e6; border: 1px solid #fcd34d; margin: 4px 0 8px; font-size: .84rem; }
.pv-attn ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 1px; }
:root[data-theme="dark"] .pv-attn { background: #3b2f12; border-color: #a16207; }
.imp-card .foot-right { display: inline-flex; align-items: center; gap: 2px; }
.imp-eye { font-size: .9rem; padding: 2px 5px; opacity: .75; }
.imp-eye:hover { opacity: 1; }
.imp-view .deal-steps { grid-template-columns: repeat(5, 1fr); }

.fd-hours { margin: 0 0 14px; }
.fh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.fh-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fh-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 10px 0 12px; }
.fh-kpis > div { background: var(--bg-alt); border-radius: 10px; padding: 8px 12px; display: grid; gap: 2px; border-left: 4px solid #16a34a; }
.fh-kpis > div.ok { border-left-color: #3b82f6; }
.fh-kpis > div.warn { border-left-color: #f59e0b; }
.fh-kpis small { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.fh-kpis b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.fh-kpis span { font-size: .72rem; color: var(--muted); }
.fh-table td.ok, .fh-table .ok { color: #2563eb; }
.fh-table td.late { color: #d97706; font-weight: 600; }
.fh-client { cursor: pointer; }
.fh-client .link-btn { margin: 0; font-weight: 700; }
.fh-entry td { background: var(--bg-alt); font-size: .8rem; }
@media (max-width: 900px) { .fh-kpis { grid-template-columns: 1fr 1fr; } }
.tcard .card-edit { font-size: .82rem; padding: 2px 5px; opacity: .55; }
.tcard:hover .card-edit { opacity: 1; }
.task-view .meet-head small { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fh-modal { max-width: 100%; }
#genDialog:has(.fh-modal) { width: min(1100px, 95vw); }
.fh-mail { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; margin: 8px 0; }

.fh-modal .fh-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.fh-modal .fh-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.fh-modal .fh-filters .select { width: auto !important; min-width: 150px; }

.th-form2 { display: grid; gap: 8px; margin-top: 10px; }
.th-row1 { display: grid; grid-template-columns: 160px 130px auto auto; gap: 10px; align-items: end; }
.th-row1 label, .th-note2 { display: grid; gap: 3px; font-size: .74rem; color: var(--muted); font-weight: 600; }
.th-row1 label.check { display: flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; padding-bottom: 7px; }
.th-row1 .input.xs { width: 100% !important; height: 32px; }
.th-note2 textarea { width: 100%; resize: vertical; min-height: 54px; font-size: .86rem; }
.th-note2 small { font-weight: 400; }
.th-row3 { display: flex; justify-content: flex-end; }
@media (max-width: 700px) { .th-row1 { grid-template-columns: 1fr 1fr; } }
#genDialog:has(.fh-modal) { width: min(1320px, 96vw) !important; max-width: none !important; }
#genDialog:has(.fh-modal) .fh-modal { max-height: 90vh; overflow-y: auto; }
#genDialog.fh-full:has(.fh-modal) { width: calc(100vw - 24px) !important; height: calc(100vh - 24px); max-height: none; }
#genDialog.fh-full .fh-modal { max-height: calc(100vh - 40px); }
.fh-modal .fh-table td, .fh-modal .fh-table th { font-size: .86rem; }
.fh-st { font-size: .68rem; font-weight: 700; border-radius: 999px; padding: 0 7px; background: var(--bg-alt); color: var(--muted); }
.fh-st.s2 { background: #dbeafe; color: #1d4ed8; } .fh-st.s3 { background: #fef3c7; color: #b45309; }
.fh-st.s4 { background: #dcfce7; color: #15803d; } .fh-st.s5 { background: #e5e7eb; color: #4b5563; }.stat .stat-origin { font-size: .78em; opacity: .7; font-weight: 600; }

/* Isotipo KLOUSEN (imagen con fondo transparente) en lugar de la letra */
.logo:has(img) { background: none; clip-path: none; border-radius: 0; width: 34px; height: 34px; padding: 0; box-shadow: none; }
.logo.sm:has(img) { width: 22px; height: 22px; }
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 2px 4px rgba(106, 60, 240, .25)); }
.brand { gap: 8px; letter-spacing: .04em; }
.auth-brand .logo:has(img) { background: #fff; border-radius: 10px; padding: 4px; width: 38px; height: 38px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }

/* Registro / inicio de sesión con Microsoft */
.btn-ms { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1b1f3b; border: 1px solid #c9cbe0; font-weight: 600; padding: 12px 16px; border-radius: 12px; }
.btn-ms:hover { background: #f4f5fb; border-color: #8a8fb5; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; margin: 14px 0 4px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-flash { background: #fff4e5; color: #8a4b00; border: 1px solid #ffd9a8; border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 6px 0 12px; }
.auth-flash.ok { background: #e9f9f0; color: #146c43; border-color: #b4e7cb; }
.pending-req { border: 1px solid #ffd9a8; background: linear-gradient(180deg, #fffaf2, var(--surface, #fff)); }
.pending-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pending-row .u-info { flex: 1; min-width: 220px; display: flex; flex-direction: column; }
.count-pill { background: #ff2d78; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .75rem; margin-left: 6px; vertical-align: middle; }

/* Multiempresa: empresa activa bajo el logo y panel Empresas */
.tenant-box { margin: -4px 8px 10px; }
.tenant-pick { display: flex; align-items: center; gap: 8px; background: var(--bg-alt, #f3f2fb); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; font-size: .88rem; }
.tenant-pick select { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; outline: none; }
.tenant-pick.single b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-ico { font-size: .95rem; }
.tn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 12px; }
.tn-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface, #fff); }
.tn-top { display: flex; gap: 10px; align-items: center; }
.tn-top div { display: flex; flex-direction: column; }
.tn-logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--grad, linear-gradient(130deg, #6a3cf0, #ff2d78)); }
.tn-stats { display: flex; gap: 14px; font-size: .88rem; }
.tn-ms { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }

/* Sección ROOT (solo dueño de la plataforma) */
.ws-name.ws-root { color: #c2185b; border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 8px; }
.ws-name.ws-root::before { content: '🔒 '; }

.tenant-pick.support { background: #fff4e5; border-color: #ffc46b; }
.support-banner { margin-top: 6px; font-size: .78rem; line-height: 1.3; background: #fff4e5; color: #8a4b00; border: 1px solid #ffd9a8; border-radius: 8px; padding: 6px 8px; }

/* Confirmación al pinchar el logo (salir al inicio) */
.leave-dlg { border: 0; border-radius: 18px; padding: 28px 28px 22px; max-width: 420px; width: calc(100% - 32px); text-align: center; box-shadow: 0 24px 60px rgba(27, 31, 59, .25); background: var(--surface, #fff); color: var(--text); }
.leave-dlg::backdrop { background: rgba(27, 31, 59, .35); backdrop-filter: blur(2px); }
.leave-dlg h3 { margin: 10px 0 6px; }
.leave-dlg p { margin: 0 0 18px; font-size: .92rem; }
.leave-dlg .row-btns { justify-content: center; flex-wrap: wrap; gap: 8px; }
.leave-ico img { width: 52px; height: 52px; object-fit: contain; }

/* Solicitar demo */
.signup .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.signup { flex-wrap: wrap; justify-content: center; }
.demo-row.done { opacity: .6; }

/* «Ver como» (ROOT, solo lectura) */
.tenant-pick.viewas { background: #eef4ff; border-color: #8fb3ff; }
.support-banner.viewas { background: #eef4ff; color: #1e3a8a; border-color: #bcd0ff; display: flex; flex-direction: column; gap: 6px; }
body.view-as .main { box-shadow: inset 0 4px 0 #5b8cff; }

/* Mi cuenta: botón con foto arriba a la derecha + menú */
.me-chip-wrap { position: relative; }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface, #fff); color: var(--text); cursor: pointer; font: inherit; font-weight: 600; }
.me-chip:hover { border-color: #b9b2f5; box-shadow: 0 4px 14px rgba(106, 60, 240, .15); }
.me-chip-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-caret { font-size: .7rem; opacity: .6; }
.me-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 290px; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 40px rgba(27, 31, 59, .18); padding: 8px; z-index: 60; }
.me-menu-head { display: flex; gap: 12px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.me-menu-head div { display: flex; flex-direction: column; min-width: 0; }
.me-menu-head small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.me-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 9px; font: inherit; color: var(--text); cursor: pointer; }
.me-item:hover { background: var(--bg-alt, #f3f2fb); }
.me-item.danger { color: #c2185b; }
.me-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
@media (max-width: 760px) { .me-chip-name, .me-caret { display: none; } .me-chip { padding: 3px; } }
/* Fotos de perfil */
.av.photo { padding: 0; overflow: hidden; background: #eee; }
.av.photo img, #meAvatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
#meAvatar.photo { padding: 0; overflow: hidden; }
.av.lg { width: 44px; height: 44px; font-size: 1rem; }
/* Página Mi perfil */
.prof-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.prof-grid > .panel { margin: 0; }
.prof-grid > .prof-card { grid-row: span 3; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.prof-photo { width: 128px; height: 128px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--grad, linear-gradient(130deg, #6a3cf0, #ff2d78)); color: #fff; font-size: 2.6rem; font-weight: 800; box-shadow: 0 10px 30px rgba(106, 60, 240, .25); margin-top: 6px; }
.prof-photo img { width: 100%; height: 100%; object-fit: cover; }
.prof-card h3 { margin: 6px 0 0; }
.prof-card p { margin: 0; font-size: .9rem; }
.prof-meta { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; width: 100%; }
.prof-rows { display: flex; flex-direction: column; }
.prof-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.prof-row:first-child { border-top: 0; }
.prof-row > div { display: flex; flex-direction: column; }
.prof-row small { color: var(--muted); font-size: .82rem; }
@media (max-width: 900px) { .prof-grid { grid-template-columns: 1fr; } .prof-grid > .prof-card { grid-row: auto; } }
.me-menu-head .av { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; padding: 0; }
.me-sec { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 4px 10px 2px; }
#meBox .me-info, #meAvatar { cursor: pointer; }

/* Vista Integraciones */
.integ-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 14px; }
.integ-intro p { margin: 0; color: var(--muted); }
.integ-jump { display: flex; flex-wrap: wrap; gap: 6px; }
.integ-jump a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface, #fff); font-size: .85rem; font-weight: 600; color: var(--text); text-decoration: none; }
.integ-jump a:hover { border-color: #b9b2f5; }
#view-integrations > div[id] { scroll-margin-top: 90px; }
.prof-wide > .panel { margin: 0; }
.prof-wide:empty { display: none; }
.integ-group { margin: 22px 2px 10px; color: var(--muted); font-size: .92rem; }
#bkSub { flex: 1; }

/* Interruptores: verde = activo · gris = desactivado (en toda la app) */
.switch span { background: #cbd2de !important; }
.switch input:checked + span { background: #16a34a !important; }
.switch input:not(:checked) + span::before { box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:disabled + span { opacity: .45; }
/* Permisos del equipo: verde = completo · ámbar = parcial · gris = sin acceso */
.select.acc-lvl { font-weight: 600; border-width: 1.5px; }
.select.acc-lvl.lvl-on { color: #15803d; background-color: #ecfdf3; border-color: #a7e3bf; }
.select.acc-lvl.lvl-mid { color: #a16207; background-color: #fffbeb; border-color: #f5d98a; }
.select.acc-lvl.lvl-off { color: #6b7280; background-color: #f3f4f6; border-color: #d7dbe2; }
.select.acc-lvl:disabled { opacity: .7; }

/* Lynx abierto: el botón queda marcado (pincharlo de nuevo lo cierra) */
#sideMolly.is-open { box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 0 6px #a855f7; }
#openMolly.is-open { box-shadow: inset 0 0 0 2px #a855f7; }

/* Aire entre los campos y los botones (Mi perfil, integraciones, empresas) */
.integ-grid + .row-btns, .integ-grid + .integ-opts, .integ-opts + .row-btns { margin-top: 18px; }
#profForm .row-btns { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

.pz-img-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pz-img-btns .pz-upload { flex: 1; }
.pz-remove { color: #c2185b; }

/* Sugerencia de la próxima videollamada (Reuniones) */
.meet-suggest { margin: 12px 0 4px; border: 1px solid #d9d3fb; background: linear-gradient(135deg, #f6f3ff, #fff5f9); border-radius: 14px; padding: 12px 14px; }
.ms-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ms-main > div:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 200px; }
.ms-main small { font-size: .78rem; color: #6a3cf0; font-weight: 600; }
.ms-main small.muted { color: var(--muted); font-weight: 500; }
.ms-main b { font-size: 1rem; }
.ms-ico { font-size: 1.6rem; }
.ms-more { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #d9d3fb; }
.ms-other { border: 1px solid var(--border); background: var(--surface, #fff); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .82rem; cursor: pointer; }
.ms-other:hover { border-color: #b9b2f5; }
.ms-manual { margin-top: 10px; font-size: .85rem; }
.ms-more small.muted { align-self: center; }

/* «Grabar manualmente»: visible como botón, sin competir con «Que Lynx se una» */
.ms-manual { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; border: 1.5px dashed #b9a6f7; background: rgba(255,255,255,.75); color: #5b3ad6; border-radius: 999px; padding: 7px 14px; font-size: .86rem; }
.ms-manual:hover { border-style: solid; background: #fff; box-shadow: 0 4px 14px rgba(106,60,240,.15); }
.ms-manual small { color: var(--muted); font-weight: 500; }

/* Mi perfil en dos columnas: tarjeta + calendario de Outlook a la izquierda; datos y ajustes a la derecha */
.prof-side, .prof-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.prof-side > .panel, .prof-main > .panel, .prof-side #outlookMine > .panel { margin: 0; }
.prof-grid > .prof-side .prof-card { grid-row: auto; }
.prof-side { position: sticky; top: 90px; }
@media (max-width: 900px) { .prof-side { position: static; } }

/* Vacaciones (Mi calendario y horas) */
.vac-panel .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vac-bal { display: flex; align-items: baseline; gap: 8px; padding: 6px 0 10px; }
.vac-bal b { font-size: 1.5rem; color: #15803d; }
.vac-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.vac-row > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.vac-row small { color: var(--muted); font-size: .8rem; }
.vac-st { font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.vac-st.st-pend { background: #fffbeb; color: #a16207; } .vac-st.st-ok { background: #ecfdf3; color: #15803d; }
.vac-st.st-no { background: #fef2f2; color: #b91c1c; } .vac-st.st-off { background: #f3f4f6; color: #6b7280; }
.vac-bals { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.vac-bals summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.vac-bal-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.vac-bal-row span { flex: 1; font-size: .88rem; }
.vac-bal-row .input { width: 84px; padding: 5px 8px; }
.tn-del { color: #c2185b; }
.tn-del:hover { background: #fef2f2; border-color: #f5b5c8; }
.tn-ms-view { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; }
.tn-ms-view span { background: #ecfdf3; color: #15803d; border-radius: 999px; padding: 2px 10px; font-weight: 600; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.tn-ms-add { font-size: .86rem; text-align: left; }

/* Rubro de la empresa (tarjetas de Empresas) */
.tn-prof { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tn-prof span { background: #f3f0ff; color: #5b3ad6; border-radius: 999px; padding: 3px 10px; font-weight: 600; font-size: .82rem; }
.tn-prof-edit { display: flex; flex-direction: column; gap: 6px; }
.tn-prof-edit .row-btns, .tn-prof-edit button { align-self: flex-start; }

/* Ventana «Nueva empresa» */
.tn-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.tn-dialog { border: 0; border-radius: 18px; padding: 24px 26px 20px; width: min(720px, calc(100% - 32px)); max-height: calc(100vh - 40px); overflow: auto;
  box-shadow: 0 24px 60px rgba(27, 31, 59, .28); background: var(--surface, #fff); color: var(--text); }
.tn-dialog::backdrop { background: rgba(27, 31, 59, .4); backdrop-filter: blur(2px); }
.tnd-sec { margin: 18px 0 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: #6a3cf0; }
.tnd-prof-desc { margin: 6px 2px 0; min-height: 1em; }
.tnd-adv { margin-top: 12px; }
.tnd-adv summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); }
.tnd-adv .integ-grid { margin-top: 10px; }
.tn-dialog .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.input.invalid { border-color: #e11d48 !important; box-shadow: 0 0 0 3px rgba(225, 29, 72, .12); }

/* Mi Equipo: organización por equipos */
.org-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.org-team { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 16px; padding: 14px; box-shadow: 0 4px 16px rgba(27,31,59,.05); }
.org-team.loose { border-style: dashed; }
.org-team header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.org-team header h3 { margin: 0; font-size: 1rem; }
.org-team .member { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.org-team .member.is-lead { background: linear-gradient(135deg, #f6f3ff, #fff5f9); border: 1px solid #e4dcfb; margin-bottom: 8px; }
.org-team .member.is-me { box-shadow: inset 3px 0 0 #a855f7; }
.org-crew { display: flex; flex-direction: column; gap: 2px; border-left: 2px solid #ece8fb; margin-left: 20px; padding-left: 10px; }
.org-team .member-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.org-team .member-info small { font-size: .8rem; }
.member-role { max-width: 220px; padding: 3px 8px; font-size: .82rem; }
.lead-badge { font-size: .7rem; background: #fff4d6; color: #9a6700; border-radius: 999px; padding: 1px 7px; font-weight: 700; vertical-align: middle; }
.select.xs { padding: 3px 6px; font-size: .78rem; max-width: 150px; }

/* Mi Equipo: el organigrama ocupa todo el ancho (no la grilla de tarjetas antigua) */
.team-grid:has(.org-grid), .team-grid:has(> .empty) { display: block; }
.org-team .member { align-items: flex-start; border: 1px solid var(--border); background: var(--surface, #fff); }
.org-team .member-info small { white-space: normal; }
.org-team .member-cargo { color: var(--text, #1b1f3b); font-weight: 600; }
.member-edit { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.member-edit .member-role, .member-edit .select { flex: 1 1 130px; min-width: 0; max-width: none; }
.member-btns { display: flex; gap: 2px; flex: none; }

/* Mi Equipo · «Ver sus tareas» */
.person-tasks h3 { display: flex; align-items: center; gap: 8px; }
.pt-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.pt-row { width: 100%; display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; text-align: left; font: inherit; color: inherit;
  background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.pt-row:hover { border-color: #c9b8f5; background: #faf8ff; }
.pt-row.is-done .pt-title { color: var(--muted); text-decoration: line-through; }
.pt-st { font-size: .8rem; font-weight: 600; }
.pt-st.st-doing { color: #2563eb; } .pt-st.st-done { color: #0f9d76; } .pt-st.st-todo { color: var(--muted); }
.pt-due { font-size: .8rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) { .pt-row { grid-template-columns: 1fr auto; } .pt-st { grid-column: 1 / -1; } }

/* CRM · Análisis */
.crm-analysis { --ca-won: #7c3aed; --ca-fc-bg: #ede9fe; --ca-fc-line: #8b5cf6; display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.ca-card { padding: 18px 20px; }
.ca-card h3 { margin: 0 0 2px; font-size: 1rem; }
.ca-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ca-legend { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); }
.ca-legend span, .ca-tip span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.sw.won { background: var(--ca-won); }
.sw.fc { background: repeating-linear-gradient(45deg, var(--ca-fc-bg) 0 3px, var(--ca-fc-line) 3px 4.5px); border: 1px solid var(--ca-fc-line); }
.ca-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 14px 0 8px; }
.ca-chips > div { background: #f8f6ff; border: 1px solid #ece8fb; border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; }
.ca-chips small { color: var(--muted); font-size: .76rem; }
.ca-chips b { font-size: 1.05rem; }
.ca-chips b small { font-weight: 500; }
.ca-chart { position: relative; }
.ca-svg { width: 100%; height: auto; display: block; overflow: visible; }
.ca-grid { stroke: var(--border, #e7e7ef); stroke-width: 1; }
.ca-base { stroke: #c9c6d9; stroke-width: 1; }
.ca-ax { font-size: 11px; fill: var(--muted, #6b6f86); }
.ca-ax.cur { font-weight: 700; fill: var(--text, #1b1f3b); }
.ca-now { fill: #f6f3ff; }
.ca-won { fill: var(--ca-won); }
.ca-fc { fill: url(#caHatch); stroke: var(--ca-fc-line); stroke-width: 1; }
.ca-fc-bg { fill: var(--ca-fc-bg); }
.ca-fc-line { stroke: var(--ca-fc-line); stroke-width: 1.5; opacity: .7; }
.ca-hit { fill: transparent; cursor: default; }
.ca-hit:hover { fill: rgba(124, 58, 237, .05); }
.ca-tip { position: absolute; pointer-events: none; background: #1b1f3b; color: #fff; border-radius: 10px; padding: 8px 11px; font-size: .8rem;
  display: flex; flex-direction: column; gap: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: 200px; z-index: 2; }
.ca-tip[hidden] { display: none; }
.ca-tip small { opacity: .75; }
.ca-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.ca-hbars { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 8px; }
.ca-hrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "t t"; gap: 4px 10px; }
.ca-hlabel { grid-area: l; display: flex; flex-direction: column; min-width: 0; }
.ca-hlabel span { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-hlabel small { color: var(--muted); font-size: .76rem; }
.ca-hrow > b { grid-area: v; font-size: .9rem; align-self: end; }
.ca-htrack { grid-area: t; height: 10px; background: #f1eff8; border-radius: 999px; overflow: hidden; }
.ca-htrack i { display: block; height: 100%; background: var(--ca-won); border-radius: 999px; }
.ca-health { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.ca-hgroup h4 { margin: 0 0 6px; font-size: .86rem; display: flex; align-items: center; gap: 6px; }
.ca-deal { display: flex; flex-direction: column; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--surface, #fff);
  border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; margin-bottom: 5px; cursor: pointer; }
.ca-deal:hover { border-color: #c9b8f5; background: #faf8ff; }
.ca-deal span { font-weight: 600; font-size: .86rem; }
.ca-deal small { color: var(--muted); font-size: .76rem; }
.ca-ok { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #ecfdf5; color: #0f7a5c; font-size: .88rem; }

/* Mi Equipo · agregar persona: tarjeta separada de la barra superior */
#view-team .team-form.panel { margin: 18px 0 22px; padding: 16px 18px; align-items: flex-end; gap: 10px 12px; }
#view-team .team-form .tf-title { flex: 1 1 100%; display: flex; flex-direction: column; gap: 2px; }
#view-team .team-form .tf-title small { color: var(--muted); font-size: .82rem; }
#view-team .team-form .select { flex: 2 1 260px; min-width: 200px; }
#view-team .team-form .input { flex: 1 1 200px; }
#view-team .org-tools { margin-top: 0; }

/* Usuarios y roles · cargo editable */
.u-cargo { min-width: 150px; max-width: 220px; }


.user-form .pw-gen { display: flex; gap: 6px; align-items: center; flex: 1 1 230px; min-width: 0; }
.user-form .pw-gen[hidden] { display: none; }
.user-form .pw-gen .input { min-width: 0; }
.user-form .pw-gen .btn, .user-form > .btn { flex: none; }


.acc-support { display: block; margin-top: 3px; font-size: .72rem; color: #9a6700; white-space: nowrap; }


/* Usuarios y roles: 4 roles */
.roles-help { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }


/* Lynx en el celular (Telegram / WhatsApp) */
.chat-sub { margin: 14px 0 6px; font-size: .88rem; }
.chat-warn { margin: 6px 0 12px; padding: 9px 12px; border-radius: 10px; background: #fff8e6; color: #8a5a00; font-size: .84rem; border: 1px solid #f5e2b3; }
.my-chats .chat-row > div { display: flex; flex-direction: column; gap: 4px; }
.chat-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; letter-spacing: .12em; color: var(--text, #1b1f3b);
  background: #f3efff; border: 1px dashed #c9b8f5; border-radius: 6px; padding: 1px 8px; }
.chat-notify { margin-top: 4px; font-size: .8rem; }
.chat-safe { margin: 10px 0 0; }
.my-chats code { font-size: .8rem; }

/* Facturación y cobros (1 UF por usuario) */
.b-flash { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.b-flash.ok { background: #ecfdf5; color: #0f7a5c; border: 1px solid #b7ebd6; }
.b-flash.bad { background: #fff1f2; color: #b4232f; border: 1px solid #fbc8ce; }
.b-plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.b-plan-head h3 { margin: 0 0 2px; }
.b-note { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: #f8f6ff; font-size: .88rem; }
.b-note.trial { background: #fff8e6; color: #8a5a00; }
.pstatus.b-trial { background: #fff4d6; color: #9a6700; }
.b-chips { margin: 14px 0 0; }
.b-chips > div small + small, .b-chips > div b + small { margin-top: 2px; }
.b-due { margin: 12px 0 0; color: #b4232f; font-size: .9rem; }
.b-test { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: #eef6ff; color: #1d4f91; font-size: .84rem; }
.b-detail { padding: 6px 4px 10px; }
.b-lines { margin-top: 6px; }
.b-pays { margin: 10px 0 0; padding-left: 18px; font-size: .84rem; color: var(--muted); }
.b-root-tools { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.b-root-tools label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
.b-ex { font-size: .8rem; white-space: nowrap; }

/* Detalle del cobro: por qué paga cada persona */
.b-why { font-size: .8rem; color: var(--muted); max-width: 320px; }
.b-gone td { background: #fafafc; }
.b-gone td:first-child { opacity: .8; }
.b-off { display: inline-block; margin-left: 6px; font-size: .7rem; font-weight: 700; color: #8a5a00; background: #fff4d6; border-radius: 999px; padding: 1px 7px; }
.b-cost { margin: 6px 0 0; font-size: .82rem; color: #1d4f91; }
.b-cost:empty { display: none; }

/* ===== KLOUSEN Pro · ERP ===== */
.x-pro-tag { margin-left: auto; font-size: .62rem; font-weight: 800; letter-spacing: .06em; color: #fff; background: linear-gradient(135deg, #7c3aed, #e00a57); border-radius: 999px; padding: 1px 7px; }
.x-pro { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.x-pro b { background: linear-gradient(135deg, #7c3aed, #e00a57); -webkit-background-clip: text; background-clip: text; color: transparent; }
.x-pro.big { font-size: 1rem; }
.x-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.x-tabs { flex-wrap: wrap; }
.x-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.x-bar .grow { flex: 1; }
.x-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.x-chips .chip { border: 1px solid var(--border); background: var(--surface, #fff); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: .8rem; cursor: pointer; color: inherit; }
.x-chips .chip.on { background: #1b1f3b; color: #fff; border-color: #1b1f3b; }
.x-kpis { margin: 0 0 16px; }
.x-mt { margin-top: 16px; }
.x-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.x-flow-node, .x-chain-node { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 92px; padding: 8px 10px; border-radius: 12px; border: 1px solid #ece8fb;
  background: #f8f6ff; font: inherit; color: inherit; cursor: pointer; }
.x-flow-node:hover, .x-chain-node:hover { border-color: #c9b8f5; }
.x-flow-node span, .x-chain-node span { font-size: 1.1rem; }
.x-flow-node b, .x-chain-node b { font-size: .76rem; text-align: center; }
.x-flow-node small, .x-chain-node small { font-size: .72rem; color: var(--muted); }
.x-flow-arrow { color: #a99be0; font-weight: 700; }
.x-chain { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; padding: 10px; background: #fbfaff; border-radius: 12px; }
.x-chain-node.on { background: linear-gradient(135deg, #7c3aed, #e00a57); color: #fff; border-color: transparent; }
.x-chain-node.on small { color: #fff; opacity: .85; }
.x-table td.t-title { cursor: pointer; }
.x-table tr[data-xdoc] { cursor: pointer; }
.x-low { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: .85rem; border-bottom: 1px dashed var(--border); }
.x-lowrow td { background: #fff8f8; }
.x-start ol { margin: 8px 0 12px 18px; display: grid; gap: 4px; }
.x-start li.done { color: #0f7a5c; text-decoration: line-through; }
.x-recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.x-recipe ul { margin: 8px 0; padding-left: 18px; font-size: .86rem; }
.x-masters .x-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; margin-top: 8px; }
.x-item { display: flex; flex-direction: column; text-align: left; font: inherit; color: inherit; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.x-item:hover { border-color: #c9b8f5; }
.x-item small { color: var(--muted); font-size: .76rem; }
.x-item.off { opacity: .5; }
.x-bom { margin-top: 12px; padding: 10px; border-radius: 10px; background: #fbfaff; }
.x-bom h4 { margin: 0 0 8px; font-size: .88rem; }
.x-bomrow, .x-jrow { display: grid; grid-template-columns: 1fr 110px 32px; gap: 6px; margin-bottom: 6px; }
.x-jrow { grid-template-columns: 1fr 140px 140px; }
.x-lines td { vertical-align: top; }
.x-lines td:first-child { min-width: 260px; display: flex; flex-direction: column; gap: 4px; }
.x-lines input.num { max-width: 110px; text-align: right; }
.x-totals { display: flex; justify-content: flex-end; gap: 18px; flex-wrap: wrap; margin: 10px 0; font-size: .9rem; }
.x-totals .x-total { font-size: 1.05rem; }
.x-notes { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: .82rem; color: var(--muted); }
.x-opneed { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fbfaff; font-size: .88rem; }
.x-dte { color: #1d4f91; font-weight: 600; }
.x-docnotes { white-space: pre-wrap; font-size: .86rem; color: var(--muted); }
.x-actions { margin: 12px 0; }
.x-det { margin-top: 8px; font-size: .86rem; }
.x-det summary { cursor: pointer; font-weight: 600; }
.x-entry { margin: 8px 0 12px; }
.x-entry-h { font-size: .84rem; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.x-report h3 { margin: 0 0 10px; }
.x-report tr.x-sec td { font-weight: 700; background: #f8f6ff; }
.x-report tr.x-sub td { font-weight: 700; }
.x-report tfoot td { border-top: 2px solid #1b1f3b; }
.x-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .x-2col { grid-template-columns: 1fr; } }
.x-inline { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pstatus.x-st-por-aprobar { background: #fff4d6; color: #9a6700; }
.pstatus.x-st-pagada, .pstatus.x-st-convertida, .pstatus.x-st-terminada, .pstatus.x-st-registrado { background: #ecfdf5; color: #0f7a5c; }
.pstatus.x-st-anulada, .pstatus.x-st-rechazada, .pstatus.x-st-acreditada { background: #fff1f2; color: #b4232f; }
.pstatus.x-st-emitida, .pstatus.x-st-aprobada, .pstatus.x-st-abierta { background: #eef6ff; color: #1d4f91; }
/* Invitación a Pro */
.x-up { max-width: 1000px; margin: 0 auto; text-align: center; }
.x-up-hero h2 { font-size: 1.7rem; margin: 8px 0; }
.x-up-hero p { color: var(--muted); max-width: 720px; margin: 0 auto 18px; }
.x-up-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; text-align: left; margin-bottom: 18px; }
.x-up-card { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 14px; background: var(--surface, #fff); border: 1px solid var(--border); }
.x-up-card span { font-size: 1.4rem; }
.x-up-card small { color: var(--muted); }
.x-up-price { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 640px; margin: 0 auto 16px; }
.x-up-price > div { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface, #fff); }
.x-up-price > div.pro { border: 2px solid #a855f7; background: linear-gradient(135deg, #f8f4ff, #fff5f9); }
.x-up-price small, .x-up-price em { color: var(--muted); font-size: .8rem; font-style: normal; }
.b-planrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .88rem; }

/* ERP: documentos en una ventana más amplia */
dialog:has(.x-docform), dialog:has(.x-doc) { width: min(1080px, 96vw); max-width: 96vw; }


/* ===== WMS ===== */
.w-ok { font-size: .82rem; color: #0f7a5c; font-weight: 600; }
.w-off ul { margin: 8px 0 14px 18px; }
.w-tasks { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.w-task { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface, #fff); border-left: 4px solid #a99be0; }
.w-task.w-pick { border-left-color: #e00a57; } .w-task.w-count { border-left-color: #2563eb; }
.w-task small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.w-zone h4 { margin: 12px 0 6px; font-size: .86rem; }
.w-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.w-loc { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: #f4f4f7;
  font: inherit; color: inherit; cursor: pointer; text-align: left; }
.w-loc b { font-size: .74rem; } .w-loc small { font-size: .68rem; color: var(--muted); }
.w-loc.used { background: #efe9ff; border-color: #c9b8f5; }
.w-loc.k-recepcion, .w-loc.k-despacho { background: #eef6ff; border-color: #b9d3f3; }
.w-loc.k-cuarentena { background: #fff1f2; border-color: #fbc8ce; }
.w-loc.on { outline: 2px solid #7c3aed; }
.w-form { margin-top: 10px; }
.w-labels { margin: 10px 0; }
.w-scan { display: flex; gap: 8px; margin: 6px 0; }
.w-scan .input { flex: 1; font-size: 1rem; }
#wCam video { width: 100%; max-height: 260px; border-radius: 12px; background: #000; margin: 6px 0; }
.w-hint { padding: 10px 12px; border-radius: 10px; background: #f8f6ff; font-size: .92rem; margin: 6px 0 10px; }
.w-steps { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow: auto; }
.w-step { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: var(--surface, #fff); }
.w-step.on { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); cursor: default; }
.w-step.ok { background: #f2fbf7; border-color: #b7ebd6; }
.w-step-h { display: flex; gap: 10px; align-items: center; }
.w-step-h small { display: block; color: var(--muted); font-size: .8rem; }
.w-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #ece8fb; font-size: .78rem; font-weight: 700; }
.w-step.ok .w-num { background: #0f9d76; color: #fff; }
.w-step-b { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.w-step-b label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.w-in { min-width: 120px; font-size: 1rem; }
.x-lot { display: flex; gap: 4px; } .x-lot .input { min-width: 0; }
.x-lotb { color: #1d4f91; font-size: .74rem; }
.x-wmsnote { padding: 8px 12px; border-radius: 10px; background: #eef6ff; font-size: .86rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.x-routerow { display: grid; grid-template-columns: 1.4fr 1fr 100px 32px; gap: 6px; margin-bottom: 6px; }
@media (max-width: 640px) { .w-step-b { flex-direction: column; align-items: stretch; } dialog:has(.w-op) { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; } }

/* ===== Producción ===== */
.p-board { display: grid; grid-template-columns: repeat(6, minmax(170px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.p-col { background: #f6f5fb; border-radius: 14px; padding: 8px; min-height: 140px; }
.p-col-h { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .82rem; padding: 4px 4px 8px; }
.p-col-b { display: flex; flex-direction: column; gap: 8px; }
.p-empty { text-align: center; margin: 14px 0; }
.p-card { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: inherit; background: var(--surface, #fff); border: 1px solid var(--border);
  border-left: 4px solid #a99be0; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.p-card.prio-alta { border-left-color: #e00a57; } .p-card.prio-baja { border-left-color: #9ca3af; }
.p-card.late { background: #fff8f8; }
.p-card-h { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; }
.p-prod { font-size: .84rem; font-weight: 600; }
.p-card small { font-size: .72rem; color: var(--muted); }
.p-bar { height: 6px; border-radius: 999px; background: #ece8fb; overflow: hidden; }
.p-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7c3aed, #e00a57); }
.p-route { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 6px 0; font-size: .76rem; }
.p-route span { background: #f3efff; border-radius: 6px; padding: 2px 6px; } .p-route i { color: #a99be0; font-style: normal; }
.p-steps .ds-step span { font-size: .72rem; }
.p-ops { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 12px; }
.p-op { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.p-op small { display: block; color: var(--muted); font-size: .76rem; }
.p-op.st-en-curso { border-color: #7c3aed; background: #faf8ff; } .p-op.st-terminada { background: #f2fbf7; }
.p-op.st-terminada .w-num { background: #0f9d76; color: #fff; }
.p-op.rework { border-style: dashed; border-color: #e00a57; }
.p-op-act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.p-op-act .input.xs { width: 82px; }
.p-qcform, .p-close { padding: 12px 14px; border-radius: 12px; background: #fbfaff; border: 1px solid #ece8fb; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.p-qc { padding: 10px 12px; border-radius: 10px; margin: 8px 0; font-size: .86rem; }
.p-qc.aprobado { background: #ecfdf5; } .p-qc.rechazado { background: #fff1f2; }
.p-qc ul { margin: 4px 0 0 16px; }
.pstatus.x-st-planificada { background: #f4f4f7; color: #555; } .pstatus.x-st-liberada { background: #eef6ff; color: #1d4f91; }
.pstatus.x-st-en-proceso, .pstatus.x-st-en-curso { background: #f3efff; color: #6d28d9; }
.pstatus.x-st-control-de-calidad { background: #fff4d6; color: #9a6700; } .pstatus.x-st-preparada { background: #fff4d6; color: #9a6700; }
.pstatus.x-st-hecha, .pstatus.x-st-despachada { background: #ecfdf5; color: #0f7a5c; }

.p-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin: 6px 0 14px; }
.p-steps .ds-step { text-align: center; }


/* Formularios (diseño de documentos) */
.x-forms { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #fbfaff; border: 1px solid #ece8fb; }
.x-logo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.x-logo-prev { width: 200px; height: 80px; border: 1px dashed #c9b8f5; border-radius: 10px; display: grid; place-items: center; background: #fff; overflow: hidden; }
.x-logo-prev img { max-width: 190px; max-height: 72px; object-fit: contain; }
.x-color { display: flex; align-items: center; gap: 8px; }
.x-color input[type=color] { width: 54px; height: 34px; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: #fff; }
.x-terms textarea { min-height: 52px; }

/* Distintivo PRO junto al logo principal */
.brand-pro { font-size: .62rem; font-weight: 800; letter-spacing: .08em; color: #fff; background: linear-gradient(135deg, #7c3aed, #e00a57);
  border-radius: 999px; padding: 2px 8px; margin-left: -2px; box-shadow: 0 2px 8px rgba(224, 10, 87, .25); }
.brand-pro[hidden] { display: none; }


.x-opneed:empty { display: none; }
.x-noprod { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); padding: 6px 0; }


.x-newmat { display: grid; grid-template-columns: 1.6fr 0.8fr 90px auto; gap: 6px; margin-top: 8px; padding: 8px; border-radius: 10px; background: #fff; border: 1px dashed #c9b8f5; }
.x-newmat[hidden] { display: none; }
@media (max-width: 640px) { .x-newmat { grid-template-columns: 1fr 1fr; } }



/* ===== Flota Conectada ===== */
.fl-kpis { margin-top: 4px; }
.fl-live { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: start; }
.fl-side { display: flex; flex-direction: column; gap: 8px; max-height: 640px; overflow: auto; padding: 12px; }
.fl-mapbox { padding: 0; overflow: hidden; }
.fl-map { height: 520px; width: 100%; background: var(--bg-alt); z-index: 0; }
.fl-item { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.fl-item:hover { border-color: var(--accent); }
.fl-item.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.fl-item-main { display: flex; flex-direction: column; min-width: 0; }
.fl-item-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-speed { font-weight: 800; font-size: 1.05rem; text-align: right; }
.fl-speed small { display: block; font-size: .7rem; font-weight: 600; color: var(--muted); }
.fl-dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa1bf; }
.fl-dot.fl-mov { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.fl-dot.fl-stop { background: var(--warn); }
.fl-dot.fl-off { background: #9aa1bf; }
.fl-dot.fl-lost { background: var(--danger); }
.fl-st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--bg-alt); color: var(--muted); }
.fl-st.fl-mov { background: #dcfce7; color: #166534; }
.fl-st.fl-stop { background: #fef3c7; color: #92400e; }
.fl-st.fl-lost { background: #fee2e2; color: #991b1b; }
.fl-pin-wrap { background: none; border: 0; }
.fl-pin { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; padding: 3px 9px 3px 5px; border-radius: 999px;
  background: #fff; border: 2px solid #9aa1bf; box-shadow: 0 4px 12px rgba(20, 24, 60, .25); white-space: nowrap; font: 700 11px/1.2 system-ui, sans-serif; color: #1b1f3b; }
.fl-pin i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-style: normal; font-size: 10px; color: #fff; background: #9aa1bf; }
.fl-pin.fl-mov { border-color: var(--ok); } .fl-pin.fl-mov i { background: var(--ok); }
.fl-pin.fl-stop { border-color: var(--warn); } .fl-pin.fl-stop i { background: var(--warn); }
.fl-pin.fl-lost { border-color: var(--danger); } .fl-pin.fl-lost i { background: var(--danger); }
.fl-pin.on { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); z-index: 1000; }
.fl-trackbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px 0; }
.fl-day { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); }
.fl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; padding: 10px 14px 14px; }
.fl-stats > div { padding: 8px 10px; border-radius: 10px; background: var(--bg-alt); display: flex; flex-direction: column; gap: 2px; }
.fl-stats small { color: var(--muted); font-size: .74rem; }
.fl-stats b { font-size: 1rem; }
.fl-stats .bad { background: #fee2e2; } .fl-stats .bad b { color: #991b1b; }
.fl-doc { display: inline-block; margin: 0 4px 2px 0; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--bg-alt); color: var(--muted); }
.fl-doc.ok { background: #dcfce7; color: #166534; } .fl-doc.warn { background: #fef3c7; color: #92400e; } .fl-doc.bad { background: #fee2e2; color: #991b1b; }
.fl-docs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 10px; }
.fl-mt { padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.fl-mt-ok { background: #dcfce7; color: #166534; } .fl-mt-warn { background: #fef3c7; color: #92400e; } .fl-mt-bad { background: #fee2e2; color: #991b1b; }
.fl-dtc { margin: 6px 0; padding-left: 18px; font-size: .86rem; } .fl-dtc b { color: #991b1b; }
.fl-ficha h4 { margin: 14px 0 6px; }
.fl-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.fl-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fl-alerts li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.fl-alerts li.bad { border-color: #fca5a5; background: #fff5f5; }
.fl-alerts li.warn { border-color: #fcd34d; background: #fffbeb; }
.fl-alerts li.done { opacity: .62; }
.fl-alerts li span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.fl-al-ico { font-size: 1.1rem; text-align: center; }
.fl-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.fl-way { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-alt); }
.fl-way small { color: var(--muted); }
.fl-url, .fl-key code { display: block; max-width: 100%; overflow-x: auto; white-space: nowrap; padding: 6px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: .78rem; }
.fl-pre { max-width: 100%; overflow: auto; margin: 0; padding: 8px 10px; border-radius: 8px; background: #11142b; color: #d7dbff; font-size: .74rem; line-height: 1.45; }
.fl-way .fl-pre { width: 100%; }
.fl-key { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.fl-obd { margin-top: 4px; }
.x-off td { opacity: .55; }
:root[data-theme="dark"] .fl-pin { background: #242a52; color: #eef0fb; }
:root[data-theme="dark"] .fl-alerts li.bad { background: #3b1d2a; } :root[data-theme="dark"] .fl-alerts li.warn { background: #3a2f17; }
:root[data-theme="dark"] .fl-st.fl-mov, :root[data-theme="dark"] .fl-doc.ok, :root[data-theme="dark"] .fl-mt-ok { background: #163f2c; color: #86efac; }
:root[data-theme="dark"] .fl-st.fl-stop, :root[data-theme="dark"] .fl-doc.warn, :root[data-theme="dark"] .fl-mt-warn { background: #48391a; color: #fcd34d; }
:root[data-theme="dark"] .fl-st.fl-lost, :root[data-theme="dark"] .fl-doc.bad, :root[data-theme="dark"] .fl-mt-bad, :root[data-theme="dark"] .fl-stats .bad { background: #4c1d2b; color: #fda4af; }
@media (max-width: 900px) { .fl-live { grid-template-columns: 1fr; } .fl-side { max-height: 260px; } .fl-map { height: 420px; } }


/* ===== Tesorería (conciliación, monedas, remuneraciones) ===== */
.t-import { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.t-paste { width: 100%; margin-top: 8px; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.t-lines td { vertical-align: top; }
.t-in { color: #15803d; font-weight: 700; white-space: nowrap; }
.t-out { color: #b91c1c; font-weight: 700; white-space: nowrap; }
.t-act { min-width: 300px; }
.t-sug { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.t-sug .btn { white-space: normal; text-align: left; }
.t-more { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.t-more .select { max-width: 260px; }
.t-done td { opacity: .7; }
.t-fxform { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; }
.t-payform { align-items: end; }
.t-liq { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 10px; background: var(--bg-alt); }
.t-liq small { color: var(--muted); font-size: .76rem; }
.t-liq b { font-size: 1.15rem; }
.x-fxinfo { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--bg-alt); font-size: .86rem; }
.x-fxnote { margin: 4px 0 8px; }
:root[data-theme="dark"] .t-in { color: #86efac; } :root[data-theme="dark"] .t-out { color: #fda4af; }
@media (max-width: 700px) { .t-act { min-width: 0; } }


/* ===== Traslado de bienes (Res. SII 154) ===== */
.x-tr { margin: 10px 0; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-alt); }
.x-tr summary { cursor: pointer; font-weight: 700; }
.x-tr-grid { margin-top: 10px; }
.x-tr-chk { align-self: end; }
.x-tr-motivo { grid-column: 1 / -1; }
.x-trview { margin: 10px 0; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); }
.x-trview h4 { margin: 0 0 8px; }
.x-trgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 14px; }
.x-trgrid > div { display: flex; flex-direction: column; }
.x-trgrid small { color: var(--muted); font-size: .74rem; }
.x-trgrid b { font-size: .86rem; font-weight: 600; }
.x-guide-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }


/* ===== Noticias del rubro (Vista general): cinta que avanza sola ===== */
.news { margin: 2px 0 14px; padding: 8px 0 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--card-shadow); overflow: hidden; }
.news-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .84rem; color: var(--muted); padding: 0 12px 6px 14px; }
.news-h b { color: var(--text); }
.news-act { display: flex; align-items: center; gap: 6px; }
.news-wrap { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.news-wrap.news-still { overflow-x: auto; scrollbar-width: thin; }
.news-track { display: flex; gap: 10px; width: max-content; padding: 0 14px; will-change: transform; }
.news-card { display: flex; align-items: center; gap: 12px; width: 370px; flex: none; padding: 6px 10px 6px 6px; border-radius: 10px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.news-card:hover, .news-card:focus-visible { background: var(--surface-2, rgba(127,127,127,.08)); border-color: var(--border); }
.news-card img, .news-ph { width: 112px; height: 63px; flex: none; border-radius: 8px; object-fit: cover; background: var(--surface-2, rgba(127,127,127,.12));
  transition: transform .2s; }
.news-card:hover img { transform: scale(1.04); }
.news-ph { display: grid; place-items: center; font-size: 1.4rem; }
.news-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.news-txt b { font-size: .83rem; line-height: 1.28; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card:hover .news-txt b { color: var(--accent); }
.news-txt small { color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .news-card { width: 280px; } .news-card img, .news-ph { width: 80px; height: 45px; } }

/* Correo de avisos: error visible y persistente (no se pierde lo escrito) */
.smtp-err { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: .86rem; font-weight: 600; color: #b42318; background: rgba(240, 68, 56, .1); border: 1px solid rgba(240, 68, 56, .3); }
[data-theme="dark"] .smtp-err { color: #fda29b; }

/* Correo de avisos: prueba a cualquier destinatario */
.smtp-test { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.smtp-test label { flex: 1 1 260px; max-width: 420px; display: flex; flex-direction: column; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--muted); }

/* Flota: horarios de privacidad */
.fl-privlist { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.fl-priv-row { display: grid; grid-template-columns: minmax(120px, 1fr) auto auto minmax(150px, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.fl-days { display: inline-flex; gap: 4px; }
.fl-days label { cursor: pointer; }
.fl-days input { position: absolute; opacity: 0; pointer-events: none; }
.fl-days span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-size: .78rem; font-weight: 700; border: 1px solid var(--border); color: var(--muted); }
.fl-days input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.fl-days input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.fl-hours { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.fl-hours .input { width: 110px; }
.fl-dot.fl-priv { background: #8b7cf6; }
.fl-st.fl-priv { background: #ede9fe; color: #5b21b6; }
:root[data-theme="dark"] .fl-st.fl-priv { background: #2e1f5e; color: #c4b5fd; }
@media (max-width: 900px) { .fl-priv-row { grid-template-columns: 1fr 1fr; } .fl-priv-row .fl-days, .fl-priv-row select { grid-column: span 2; } }

/* Ticketera: columnas por estado de Freshdesk (Abierta · Pendiente · Resuelto · Cerrada) */
.kanban.fd-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Tarjetas compactas: nada se sale de la columna y solo lo esencial del ticket */
.fd-board .kcol { min-width: 0; }
.fd-board .tcard { min-width: 0; overflow: hidden; padding: 12px 12px 10px; }
.fd-board .tcard * { overflow-wrap: anywhere; }
.fd-board .tcard .t-sap, .fd-board .tcard .tdesc, .fd-board .tcard .ticket-people small.muted { display: none; }
.fd-board .tcard h4 { font-size: .9rem; margin: 6px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fd-board .tcard-top { flex-wrap: wrap; gap: 4px; }
.fd-board .tcard-top .tag { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-board .ticket-people { margin: 2px 0 4px; }
.fd-board .tcard-foot { margin-top: 6px; gap: 6px; }
.fd-board .tcard-foot .due { white-space: nowrap; }
.fd-board .foot-right { min-width: 0; }
.fd-board .tcard .t-owner { max-width: 120px; }
.fd-board .tcard .t-unassigned { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.kcol[data-fdstatus="2"] .kcol-head { border-bottom: 3px solid #7c4dff; padding-bottom: 6px; }
.kcol[data-fdstatus="3"] .kcol-head { border-bottom: 3px solid #f59e0b; padding-bottom: 6px; }
.kcol[data-fdstatus="4"] .kcol-head { border-bottom: 3px solid #12b76a; padding-bottom: 6px; }
.kcol[data-fdstatus="5"] .kcol-head { border-bottom: 3px solid #8a8a96; padding-bottom: 6px; }
.kcol-sum.late { color: #d92d20; }
.sla-badge { display: inline-block; margin: 2px 0 6px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600;
  background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border); }
.sla-badge.warn { background: #fff4e0; color: #b25e00; border-color: #f5c77e; }
.sla-badge.late { background: #fdecec; color: #c0262d; border-color: #f3b0b0; }
@media (max-width: 1280px) { .kanban.fd-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .kanban.fd-board { grid-template-columns: 1fr; } }

/* ===== Ficha de un ticket de Freshdesk: ancha, dos columnas (contenido y conversación | datos) ===== */
dialog.tk-wide { width: min(1240px, 100% - 32px); max-height: calc(100vh - 40px); overflow: hidden; }
.tk-view { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.tk-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.tk-headmain { min-width: 0; }
.tk-head h3 { margin: 8px 0 4px; font-size: 1.35rem; line-height: 1.3; }
.tk-head small { color: var(--muted); }
.tk-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tk-chips .sla-badge { margin: 0; }
.tk-st { padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--bg-alt); color: var(--muted); }
.tk-st.s2 { background: #ede9fe; color: #5b3fd0; } .tk-st.s3 { background: #fef3c7; color: #a15c00; }
.tk-st.s4 { background: #dcfce7; color: #15803d; } .tk-st.s5 { background: var(--bg-alt); color: var(--muted); }
.tk-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.tk-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; min-height: 0; flex: 1; }
.tk-main { overflow-y: auto; padding: 18px 24px 24px; display: grid; gap: 18px; align-content: start; }
.tk-side { overflow-y: auto; padding: 18px 20px; border-left: 1px solid var(--border); background: var(--bg-alt); display: grid; gap: 12px; align-content: start; }
.tk-sec h4 { margin: 0 0 10px; font-size: .98rem; display: flex; align-items: center; gap: 8px; }
.tk-count { min-width: 22px; padding: 0 8px; border-radius: 999px; font-size: .74rem; text-align: center; background: var(--bg-alt); color: var(--muted); }
.tk-thread { display: grid; gap: 10px; }
.tk-older { margin-bottom: 10px; }
.tk-msg { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.tk-msg.k-cliente { border-left: 3px solid #3b82f6; }
.tk-msg.k-equipo { border-left: 3px solid var(--primary); }
.tk-msg.k-nota { border-left: 3px solid #f59e0b; background: color-mix(in srgb, #fef3c7 45%, var(--surface)); }
.tk-msg.k-origen { border-left: 3px solid #8b5cf6; }
.tk-msg.k-lynx { border-left: 3px solid #a855f7; background: linear-gradient(135deg, color-mix(in srgb, #ede9fe 55%, var(--surface)), var(--surface)); }
.k-lynx .tk-av { background: linear-gradient(135deg, #6a3cf0, #ff2d78); }
.tk-msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tk-msg-head b { font-size: .9rem; }
.tk-msg-head small { margin-left: auto; color: var(--muted); font-size: .76rem; }
.tk-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 700; color: #fff; background: #8a8a96; }
.k-cliente .tk-av { background: #3b82f6; } .k-equipo .tk-av { background: var(--primary); } .k-nota .tk-av { background: #d97706; } .k-origen .tk-av { background: #8b5cf6; }
.tk-kind { font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--bg-alt); border-radius: 999px; padding: 1px 8px; }
.tk-text { margin: 0; white-space: pre-wrap; font-size: .9rem; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.tk-text.clamp { display: -webkit-box; -webkit-line-clamp: 10; -webkit-box-orient: vertical; overflow: hidden; }
.tk-more { margin-top: 4px; font-size: .82rem; }
.tk-msg .att { margin-top: 10px; }
.tk-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.tk-card h5 { margin: 0 0 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tk-row { display: grid; gap: 1px; padding: 6px 0; border-top: 1px solid var(--border); font-size: .86rem; }
.tk-row:first-of-type { border-top: 0; padding-top: 0; }
.tk-row span { color: var(--muted); font-size: .74rem; }
.tk-row b { font-weight: 600; overflow-wrap: anywhere; }
.tk-ups p { margin: 0 0 8px; font-size: .84rem; } .tk-ups small { display: block; color: var(--muted); }
@media (max-width: 900px) {
  .tk-body { grid-template-columns: 1fr; overflow-y: auto; }
  .tk-main, .tk-side { overflow: visible; }
  .tk-side { border-left: 0; border-top: 1px solid var(--border); }
  .tk-head { flex-direction: column; }
}

/* Notas de un ticket: destino (solo KLOUSEN · nota privada · responder al cliente) */
.fd-modes { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; margin-bottom: 8px; border-radius: 12px; background: var(--bg-alt); border: 1px solid var(--border); }
.fd-mode { border: 0; background: none; font: inherit; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 9px; cursor: pointer; }
.fd-mode:hover { color: var(--text); }
.fd-mode.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.fd-mode.to-client.on { background: #2563eb; color: #fff; }
.fd-to { margin: 0 0 6px; font-size: .8rem; color: var(--muted); }
.fd-to b { color: var(--text); }
textarea.to-client { border-color: #93b4f5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.fd-after { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; font-size: .8rem; color: var(--muted); }
.fd-note-st.reply.ok { color: #1d4ed8; }

/* Horas del ticket en la columna derecha de la ficha (formato compacto) */
.tk-hours { padding: 0; }
.tk-side { grid-auto-rows: max-content; }        /* cada tarjeta con su alto completo (la columna se desplaza) */
.tk-side .ticket-hours { margin: 0; border: 0; border-radius: 0; padding: 12px 14px; }
.tk-side .th-list { max-height: 220px; }
.tk-side .th-row { grid-template-columns: 46px 1fr; gap: 8px; }
.tk-side .th-row > :last-child { grid-column: 2; }
.tk-side .th-row1 { grid-template-columns: 1fr 1fr; gap: 8px; }
.tk-side .th-row1 label.check { padding-bottom: 0; }
.tk-side .th-note2 textarea { min-height: 64px; }
.tk-side .th-row3 .btn { width: 100%; justify-content: center; }
.tk-side .th-hint { font-size: .72rem; }

/* Filtros de la ticketera (cliente · estado · prioridad) y observadores en la ficha del ticket */
.fd-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; }
.fd-filters .select { width: auto; min-width: 170px; }
.tk-watch { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tk-watch:empty { display: none; }
.tk-watch .chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 0 0 4px; }
.tk-card [data-tk-watch] { width: 100%; margin-top: 4px; }
.tk-card [data-tk-watchme] { margin-top: 8px; font-size: .82rem; }
/* En la ticketera, los filtros de arriba (responsable y módulo) se ocultan: el de responsable está en «Filtrar tickets» */
body.ticketera-view #ownerFilter, body.ticketera-view #moduleFilter { display: none; }
.tk-side { overflow-x: hidden; }
.tk-side > * { min-width: 0; }
.tk-side .th-row1 label.check { white-space: normal; }

/* Nuevo ticket en Freshdesk y botón Eliminar en la ficha */
dialog:has(.tk-new) { width: min(860px, 100% - 32px); }
.tk-new { padding: 22px 24px; display: grid; gap: 12px; }
.tk-new-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.tk-new-grid label { display: grid; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.tk-new-grid .span2 { grid-column: 1 / -1; }
.tk-new-grid .input, .tk-new-grid .select { width: 100%; color: var(--text); font-weight: 400; }
.tk-new-cons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tk-del:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
@media (max-width: 680px) { .tk-new-grid, .tk-new-cons { grid-template-columns: 1fr; } }
.fd-filters #fdNumFilter { width: 150px; }


/* --- Exportar tickets (mesa de ayuda) --- */
#genDialog:has(.fx-modal) { width: min(680px, 94vw); }
.fx-modal .select, .fx-modal .input { width: auto; }                      /* los filtros van en línea (los formularios .pd los estiran) */
.fx-modal label.fx-all, .fx-modal .fx-grid label { display: flex; color: var(--text); font-weight: 500; }
.fx-modal label.fx-all { color: var(--muted); }
.fx-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; font-size: .88rem; }
.fx-count { margin-left: auto; font-size: .8rem; font-weight: 600; color: var(--muted); }
.fx-fields { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-top: 12px; max-height: 46vh; overflow: auto; }
.fx-fields header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: .92rem; }
.fx-fields header .muted { font-size: .8rem; }
.fx-all { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.fx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; }
.fx-grid label { display: flex; align-items: flex-start; gap: 8px; font-size: .88rem; cursor: pointer; line-height: 1.3; }
.fx-grid input, .fx-all input { accent-color: var(--primary); width: 16px; height: 16px; margin: 1px 0 0; flex: none; }
@media (max-width: 560px) { .fx-grid { grid-template-columns: 1fr; } }

/* --- Registro de documentos · Negociación de tareas (negociacion.js) --- */
.dl-head-btns { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dl-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 14px; margin: 8px 0 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-alt); }
.dl-form label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
.dl-form .span2 { grid-column: span 2; }
.dl-form-btns { display: flex; justify-content: flex-end; gap: 8px; }
.dl-list { list-style: none; margin: 6px 0 4px; padding: 0; display: flex; flex-direction: column; }
.dl-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); position: relative; }
.dl-item:last-child { border-bottom: 0; }
.dl-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-alt); font-size: .9rem; }
.dl-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dl-doc { font-size: .9rem; word-break: break-word; }
.dl-doc a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.dl-doc a:hover { text-decoration-color: currentColor; }
.dl-badge, .dl-ver { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-alt); color: var(--muted); }
.dl-ver { background: transparent; border: 1px solid var(--border); }
.dl-aprobado .dl-badge, .dl-firmado .dl-badge { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.dl-rechazado .dl-badge, .dl-eliminado .dl-badge { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.dl-enviado .dl-badge, .dl-version .dl-badge, .dl-revision .dl-badge { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.dl-note { margin: 3px 0 2px; font-size: .85rem; }
.dl-src-negociacion { color: var(--accent); font-weight: 600; }
.dl-empty { padding: 6px 0; line-height: 1.45; }
.neg-key { display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.neg-newkey { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin: 10px 0; border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.neg-newkey code { font-size: .82rem; word-break: break-all; }
.neg-code { white-space: pre-wrap; word-break: break-all; font-size: .78rem; padding: 10px 12px; border-radius: 10px; background: var(--bg-alt); border: 1px solid var(--border); }
@media (max-width: 560px) { .dl-form { grid-template-columns: 1fr; } .dl-form .span2 { grid-column: auto; } }
.dl-crm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.dl-crm-bar .hint { margin: 0; max-width: 640px; }
.ptable .dl-badge { white-space: nowrap; }
.dl-from { font-weight: 600; }
/* Mis asignaciones → Mis proyectos (workspace.js: projectGroupHtml) */
#listBody tr.pg-row > td { padding: 10px 12px; background: var(--bg); }
.pg-card { border: 1px solid var(--border); border-left: 4px solid #7c4dff; border-radius: 12px; background: var(--surface); overflow: hidden; }
.pg-head { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(0, 2.4fr) auto; gap: 16px; align-items: center; padding: 14px 16px;
  background: color-mix(in srgb, #7c4dff 6%, var(--surface)); border-bottom: 1px solid var(--border); }
.pg-title { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.pg-title > div { display: grid; min-width: 0; }
.pg-title b { font-size: 1rem; }
.pg-title small { color: var(--muted); font-size: .76rem; }
.pg-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pg-stats > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.pg-stats small { flex-basis: 100%; color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pg-stats b { font-size: .86rem; }
.pg-bar { flex: 1; min-width: 60px; max-width: 140px; height: 7px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; }
.pg-bar i { display: block; height: 100%; border-radius: inherit; background: #7c4dff; }
.pg-table { width: 100%; border-collapse: collapse; }
.pg-table td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: middle; font-size: .86rem; }
.pg-table tr:first-child td { border-top: 0; }
.pg-table tr.pg-item { cursor: pointer; }
.pg-table tr.pg-item:hover td { background: var(--bg-alt); }
.pg-table .pg-check { width: 34px; text-align: center; }
.pg-table .pg-when { white-space: nowrap; color: var(--muted); width: 170px; }
.pg-table td:nth-child(4) { width: 150px; }
.pg-table td:last-child { width: 150px; }
.pg-table .t-assign { display: block; margin-top: 3px; }
.pg-kind { display: inline-block; min-width: 64px; margin-right: 6px; padding: 1px 7px; border-radius: 6px; background: var(--bg-alt); color: var(--muted);
  font-size: .68rem; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .03em; }
.pg-kind.task { background: #fff4d6; color: #9a6700; }
:root[data-theme="dark"] .pg-kind.task { background: #3d2f05; color: #fcd34d; }
.pg-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--muted); }
.pg-dot.en_curso { border-color: #7c4dff; background: linear-gradient(90deg, #7c4dff 50%, transparent 50%); }
.pg-dot.listo { border-color: #0f9d76; background: #0f9d76; }
.pz { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--bg-alt); color: var(--muted); font-size: .74rem; font-weight: 600; white-space: nowrap; }
.pz.warn { background: #fff4d6; color: #9a6700; }
.pz.late { background: #fde2e2; color: #b42318; }
.pz.ok { background: #dcfce7; color: #15803d; }
:root[data-theme="dark"] .pz.warn { background: #3d2f05; color: #fcd34d; }
:root[data-theme="dark"] .pz.late { background: #4a1414; color: #fca5a5; }
:root[data-theme="dark"] .pz.ok { background: #0f3d26; color: #86efac; }
@media (max-width: 1100px) {
  .pg-head { grid-template-columns: 1fr; }
  .pg-stats { grid-template-columns: 1fr 1fr; }
  .pg-table .pg-when { width: auto; }
}
/* Documentos del proyecto asociados a una fase / actividad (projects.js: renderProjectFiles) */
.file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.file-ref { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.file-ref .select { max-width: 280px; }
.file-group { margin: 12px 0 4px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text); }
.file-group small { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; }
/* Avance de las tareas del proyecto (projects.js: renderProjectPulse) */
.pulse-kpis { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.pulse-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 340px; overflow-y: auto; }
.pulse-feed li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.pulse-feed li.is-new { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pulse-line { font-size: .84rem; line-height: 1.4; }
.pulse-line .link-btn { font-weight: 600; }
.pulse-note { margin: 4px 0 0; padding: 6px 10px; border-left: 3px solid #7c4dff; border-radius: 6px; background: var(--bg-alt); font-size: .84rem; white-space: pre-wrap; }
.pulse-new { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--primary); color: #fff; font-size: .66rem; font-weight: 700; vertical-align: 2px; }
/* Ir a… (quick.js): buscador rápido de secciones y acciones */
.qk-open { display: flex; align-items: center; gap: 8px; width: calc(100% - 16px); margin: -2px 8px 12px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); font: inherit; font-size: .86rem;
  text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.qk-open:hover { border-color: var(--primary); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.qk-open > span:nth-child(2) { flex: 1; }
.qk-open kbd, .qk-panel kbd { padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--bg-alt);
  color: var(--muted); font: 600 .68rem/1.4 inherit; font-family: inherit; }
.qk-scrim { position: fixed; inset: 0; z-index: 1000; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px;
  background: rgba(15, 18, 40, .38); backdrop-filter: blur(2px); }
.qk-scrim[hidden] { display: none; }
.qk-panel { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border);
  border-radius: 16px; background: var(--surface); box-shadow: 0 24px 60px -12px rgba(15, 18, 40, .45); }
.qk-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.qk-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 1rem; }
.qk-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.qk-group { padding: 10px 10px 4px; color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.qk-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.qk-item.on { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.qk-item.on .qk-label { color: var(--primary); }
.qk-ic { width: 24px; text-align: center; flex: none; }
.qk-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.qk-item small { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .76rem; }
.qk-empty { padding: 24px; text-align: center; color: var(--muted); }
.qk-foot { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: .74rem; }
@media (max-width: 760px) { .qk-open kbd, .qk-foot { display: none; } }
/* Ubicación en el título (workspace.js: render) */
#viewTitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#viewTitle .title-sub { margin-left: 10px; font-size: .62em; font-weight: 600; color: var(--primary); vertical-align: middle; }
#viewTitle .title-sub > span { margin-right: 6px; color: var(--muted); font-weight: 400; }
/* Ticketera: rango de fechas de creación (workspace.js: fdDateRange) */
.fd-range { display: inline-flex; align-items: center; gap: 6px; }
.fd-range[hidden] { display: none; }
.fd-range .input { width: 150px; }
/* Preferencias → Avisos y recordatorios (automations.js: renderNotifyPrefs) */
.np-panel { margin-bottom: 18px; }
.np-table { width: 100%; }
.np-table th small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.np-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: .74rem; }
.np-table td.c, .np-table th:nth-child(3), .np-table th:nth-child(5) { text-align: center; }
.np-num { width: 72px; }
.np-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 12px 0 0; font-size: .86rem; }
/* Documentos → Entregables por asignación (projects.js: renderProjectFiles) */
.ent-list { display: grid; gap: 8px; }
.ent-item { border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.ent-item.is-done { border-left-color: #0f9d76; }
.ent-item.is-mine { box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent); }
.ent-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 10px 12px; }
.ent-name { display: grid; min-width: 0; }
.ent-name b { font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-name small { color: var(--muted); font-size: .72rem; }
.ent-owner { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; white-space: nowrap; }
.ent-end { white-space: nowrap; }
.ent-files { padding: 0 12px 10px; display: grid; gap: 6px; }
.ent-files .file-row { margin: 0; }
.ent-empty { margin: 0; padding: 0 12px 10px; color: var(--muted); font-size: .78rem; }
@media (max-width: 900px) { .ent-head { grid-template-columns: auto 1fr; } }

/* Tareas del equipo › Proyectos (workspace.js: renderTeamProjectBoard) */
.kanban.proj-board { display: grid; grid-template-columns: 1fr; gap: 16px; }
.pb-pm { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; }
.pb-pm > span { display: grid; line-height: 1.15; }
.pb-pm small { color: var(--muted); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pb-pm b { font-size: .84rem; }
.pb-card .pz { margin-right: 2px; }
.pb-owner { white-space: nowrap; }
.pb-owner > span:last-child { margin-left: 4px; font-size: .84rem; }
.pb-status { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--bg-alt); font-size: .74rem; font-weight: 600; white-space: nowrap; }
.pb-status.s-doing { background: #fff4d6; color: #9a6700; }
.pb-status.s-done { background: #dcfce7; color: #15803d; }
:root[data-theme="dark"] .pb-status.s-doing { background: #3d2f05; color: #fcd34d; }
:root[data-theme="dark"] .pb-status.s-done { background: #0f3d26; color: #86efac; }
.pb-done > summary { padding: 8px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; font-weight: 600; cursor: pointer; }
.pb-done[open] > summary { color: var(--text); }
/* Mejora continua: ficha más amplia (improvements.js: openImprovementView) */
#genDialog:has(.imp-view) { width: min(1120px, 100vw - 48px); max-height: calc(100vh - 32px); }
/* Chat: canales ligados y propuesta de canal (chat.js: offerChannel) */
.chan-suggest { color: var(--muted); font-style: italic; }
.chan-scope { display: block; margin-top: 2px; color: var(--muted); font-size: .72rem; }
.chan-offer { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; align-items: center; gap: 12px; max-width: 520px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 20px 50px -16px rgba(15, 18, 40, .45); }
.chan-offer > div:nth-child(2) { display: grid; gap: 2px; }
.chan-offer small { color: var(--muted); font-size: .78rem; }
.chan-offer-ic { font-size: 1.5rem; }

/* Vista general: indicadores (personal.js: marketHtml) */
.mk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 2px 14px 8px; font-size: .78rem; }
.mk-item { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.mk-item small { color: var(--muted); font-size: .72rem; }
.mk-item b { font-weight: 600; font-variant-numeric: tabular-nums; }
.mk-chg { font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mk-chg.up { color: #15803d; }
.mk-chg.down { color: #b42318; }
.mk-chg.flat { color: var(--muted); }
:root[data-theme="dark"] .mk-chg.up { color: #86efac; }
:root[data-theme="dark"] .mk-chg.down { color: #fca5a5; }
.mk-sep { width: 1px; height: 14px; background: var(--border); }
.mk-label { color: var(--muted); font-size: .72rem; font-weight: 600; }
.mk-at { margin-left: auto; color: var(--muted); font-size: .68rem; }

/* CRM › Análisis, versión compacta (crm.js: renderCrmAnalysis) */
.crm-analysis { --ca-won: #4f46e5; --ca-fc-bg: #eef0ff; --ca-fc-line: #818cf8; gap: 12px; }
.crm-analysis .ca-card { padding: 14px 16px; border-radius: 14px; }
.crm-analysis .ca-card h3 { font-size: .9rem; font-weight: 700; letter-spacing: .005em; }
.crm-analysis .ca-card > small, .crm-analysis .ca-head small { font-size: .74rem; }
.crm-analysis .ca-legend { font-size: .74rem; }
.crm-analysis .ca-chips { display: flex; flex-wrap: wrap; gap: 0; margin: 12px 0 6px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.crm-analysis .ca-chips > div { flex: 1 1 160px; background: none; border: 0; border-radius: 0; padding: 8px 14px; border-right: 1px solid var(--border); }
.crm-analysis .ca-chips > div:last-child { border-right: 0; }
.crm-analysis .ca-chips small { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.crm-analysis .ca-chips b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.crm-analysis .ca-chips b small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.crm-analysis .ca-ax { font-size: 10.5px; }
.crm-analysis .ca-val { font-size: 10px; font-weight: 600; fill: var(--muted, #6b6f86); font-variant-numeric: tabular-nums; }
.crm-analysis .ca-now { fill: color-mix(in srgb, var(--ca-won) 6%, transparent); }
.crm-analysis .ca-base { stroke: var(--border); }
.crm-analysis .ca-row { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.crm-analysis .ca-hbars { gap: 9px; margin: 10px 0 6px; }
.crm-analysis .ca-hrow { gap: 3px 10px; }
.crm-analysis .ca-hlabel { flex-direction: row; align-items: baseline; gap: 6px; }
.crm-analysis .ca-hlabel span { font-size: .8rem; }
.crm-analysis .ca-hlabel small { font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-analysis .ca-hrow > b { font-size: .8rem; font-variant-numeric: tabular-nums; }
.crm-analysis .ca-htrack { height: 5px; background: color-mix(in srgb, var(--ca-won) 10%, transparent); }
.crm-analysis .ca-card > .muted.small { font-size: .72rem; }
.crm-analysis .ca-health { gap: 8px; margin-top: 10px; }
.crm-analysis .ca-hgroup h4 { font-size: .76rem; margin-bottom: 2px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.crm-analysis .ca-deal { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 2px; border: 0;
  border-bottom: 1px solid var(--border); border-radius: 0; background: none; margin: 0; }
.crm-analysis .ca-deal:hover { background: none; }
.crm-analysis .ca-deal:hover span { color: var(--ca-won); }
.crm-analysis .ca-deal span { font-size: .8rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-analysis .ca-deal small { font-size: .7rem; white-space: nowrap; flex: none; }
.crm-analysis .ca-ok { font-size: .8rem; padding: 8px 10px; }
:root[data-theme="dark"] .crm-analysis { --ca-won: #818cf8; --ca-fc-bg: #24264a; --ca-fc-line: #a5b4fc; }

/* CRM: fichas de negocio / contacto y sus formularios, más amplios (crm.js: crmWide) */
#genDialog:has(.deal-view), #genDialog.crm-wide { width: min(1100px, 100vw - 48px); max-height: calc(100vh - 32px); }
#genDialog.crm-wide .pd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#genDialog.crm-wide .pd-grid label.span2 { grid-column: 1 / -1; }
@media (max-width: 900px) { #genDialog.crm-wide .pd-grid { grid-template-columns: 1fr 1fr; } }

/* ===== Jefatura · Proyectos, versión compacta (projects.js: #projView.pj-pro) ===== */
.pj-pro { --pj: #4f46e5; --pj-soft: color-mix(in srgb, var(--pj) 10%, transparent); }
:root[data-theme="dark"] .pj-pro { --pj: #818cf8; }
/* Indicadores: una franja con separadores */
.pj-pro > .kpis { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; margin-bottom: 12px; }
.pj-pro > .kpis .stat { flex: 1 1 170px; border: 0; border-right: 1px solid var(--border); border-radius: 0; box-shadow: none; background: none; padding: 12px 16px; min-height: 0; }
.pj-pro > .kpis .stat:last-child { border-right: 0; }
.pj-pro > .kpis .stat span { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pj-pro > .kpis .stat span::before { display: none; }
.pj-pro > .kpis .stat b { font-size: 1.35rem; font-variant-numeric: tabular-nums; margin: 2px 0 0; }
.pj-pro > .kpis .stat small { font-size: .72rem; }
/* Paneles */
.pj-pro .dash-grid { gap: 12px; }
.pj-pro .panel { padding: 14px 16px; border-radius: 14px; }
.pj-pro .panel-head h3 { font-size: .9rem; }
.pj-pro .panel-head small { font-size: .72rem; }
.pj-pro .legend { font-size: .72rem; margin: 4px 0 6px; }
/* Presupuesto vs. ejecutado: barras finas */
.pj-pro .bullets { gap: 4px; }
.pj-pro .bullet { padding: 8px 6px; border-radius: 8px; grid-template-columns: minmax(200px, 32%) 1fr 150px; gap: 16px; }
.pj-pro .bullet:hover { background: var(--bg-alt); }
.pj-pro .b-label b { font-size: .84rem; font-weight: 600; }
.pj-pro .b-label small { font-size: .7rem; }
.pj-pro .b-track { height: 6px; border-radius: 99px; background: var(--pj-soft); }
.pj-pro .b-fill { background: var(--pj); border-radius: 99px; }
.pj-pro .b-fill.over { background: #dc2626; }
.pj-pro .b-mark { width: 2px; top: -4px; bottom: -4px; background: var(--text); border-radius: 2px; }
.pj-pro .b-val { font-size: .86rem; font-variant-numeric: tabular-nums; }
.pj-pro .b-val small { font-size: .68rem; }
/* Proyectos por estado: fila compacta, cifras junto a la barra */
.pj-pro .sbars { gap: 7px; margin-top: 8px; }
.pj-pro .sbar { display: grid; grid-template-columns: 130px 1fr 84px; align-items: center; gap: 10px; font-size: .8rem; }
.pj-pro .sbar.zero { opacity: .45; }
.pj-pro .s-track { height: 6px; border-radius: 99px; background: var(--pj-soft); }
.pj-pro .s-fill { background: var(--pj); border-radius: 99px; }
.pj-pro .s-val { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pj-pro .s-val small { font-weight: 500; color: var(--muted); font-size: .7rem; }
/* Requieren atención: lista sobria */
.pj-pro .att-list { gap: 0; margin-top: 6px; }
.pj-pro .att-item { background: none; border-radius: 0; padding: 8px 2px; border-bottom: 1px solid var(--border); gap: 10px; }
.pj-pro .att-item:last-child { border-bottom: 0; }
.pj-pro .att-item b { font-size: .82rem; font-weight: 600; }
.pj-pro .att-item small { font-size: .72rem; }
.pj-pro .att-ic { font-size: .95rem; }
.pj-pro .att-go { font-size: .76rem; font-weight: 600; color: var(--pj); white-space: nowrap; }
/* Cartera: columnas y tarjetas compactas */
.pj-pro .kanban.pipeline { gap: 10px; }
.pj-pro .pipeline .kcol { padding: 10px; border-radius: 12px; }
.pj-pro .pipeline .kcol-head { font-size: .82rem; }
.pj-pro .pipeline .kcol-sum { font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
.pj-pro .pipeline .kcol-list { gap: 8px; }
.pj-pro .pipeline .kcol:has(.empty) { background: none; border: 1px dashed var(--border); }
.pj-pro .pcard { padding: 10px 11px; border-radius: 10px; gap: 6px; }
.pj-pro .pcard .tcard-top { gap: 4px; flex-wrap: wrap; }
.pj-pro .pcard .tcard-top .prio, .pj-pro .pcard .tcard-top .tag { font-size: .62rem; padding: 1px 6px; }
.pj-pro .pcard h4 { font-size: .84rem; line-height: 1.3; margin: 2px 0 0; }
.pj-pro .pcard .pc-money b { font-size: .95rem; font-variant-numeric: tabular-nums; }
.pj-pro .pcard .pc-money small, .pj-pro .pcard .pc-sub { font-size: .7rem; }
.pj-pro .pcard .mini-bar { height: 4px; background: var(--pj-soft); }
.pj-pro .pcard .mini-bar i { background: var(--pj); }
.pj-pro .pcard .tcard-foot { font-size: .72rem; }
.pj-pro .pcard .av { width: 24px; height: 24px; font-size: .58rem; }
/* Tabla: más densa, cifras alineadas */
.pj-pro .table-tools { margin-bottom: 8px; }
.pj-pro .ptable { font-size: .82rem; }
.pj-pro .ptable thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); font-size: .66rem; letter-spacing: .05em; padding: 10px 12px; }
.pj-pro .ptable td { padding: 8px 12px; }
.pj-pro .ptable td.num, .pj-pro .ptable tfoot td { font-variant-numeric: tabular-nums; }
.pj-pro .ptable tbody tr:hover td { background: var(--bg-alt); }
.pj-pro .ptable .t-title small { display: block; margin-top: 1px; font-size: .7rem; }
.pj-pro .ptable .pstatus { font-size: .7rem; padding: 2px 8px; }
.pj-pro .ptable .av { width: 24px; height: 24px; font-size: .58rem; }
.pj-pro .ptable .mini-bar.inline { width: 54px; height: 5px; background: var(--pj-soft); }
.pj-pro .ptable .mini-bar.inline i { background: var(--pj); }
@media (max-width: 900px) { .pj-pro .bullet { grid-template-columns: 1fr; gap: 6px; } .pj-pro .sbar { grid-template-columns: 110px 1fr 70px; } }
.pj-pro .legend .lg-fill { background: var(--pj); }
.pj-pro .legend .lg-mark { background: var(--text); width: 2px; }
.pj-pro .legend .lg-over { background: #dc2626; }

/* ===== Cartera de proyectos: tablero moderno (projects.js: renderPipeline / pcard) ===== */
.pj-pro .pk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; flex-wrap: wrap; }
.pj-pro .pk-bar .hint { margin: 0; }
.pj-pro .pk-total { font-size: .78rem; color: var(--muted); }
.pj-pro .pk-total b { margin-left: 4px; color: var(--text); font-size: .95rem; font-variant-numeric: tabular-nums; }
.pj-pro .pk-board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 4px; }
.pj-pro .pk-col { position: relative; padding: 12px 10px 10px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--stc) 4%, var(--bg-alt)); }
.pj-pro .pk-col::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--stc); }
.pj-pro .pk-col.is-empty { background: none; border-style: dashed; }
.pj-pro .pk-col.over { border-color: var(--stc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stc) 22%, transparent); }
.pj-pro .pk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; border: 0; }
.pj-pro .pk-name { font-size: .8rem; font-weight: 700; letter-spacing: .01em; display: inline-flex; align-items: center; gap: 7px; }
.pj-pro .pk-name::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--stc); }
.pj-pro .pk-head .count { background: color-mix(in srgb, var(--stc) 16%, transparent); color: var(--text); font-weight: 700; }
.pj-pro .pk-sum { display: flex; align-items: baseline; gap: 6px; padding: 4px 2px 10px; }
.pj-pro .pk-sum b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.pj-pro .pk-sum small { font-size: .7rem; color: var(--muted); }
.pj-pro .pk-empty { padding: 22px 8px; text-align: center; font-size: .74rem; color: var(--muted); border-radius: 10px; }
.pj-pro .pk-col.over .pk-empty { background: color-mix(in srgb, var(--stc) 10%, transparent); color: var(--text); }
/* Tarjeta */
.pj-pro .pc2 { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 11px 12px 10px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(15, 18, 40, .04); cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
.pj-pro .pc2::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border); }
.pj-pro .pc2.pr-alta::before { background: #ef4444; }
.pj-pro .pc2.pr-media::before { background: #f59e0b; }
.pj-pro .pc2.pr-baja::before { background: #10b981; }
.pj-pro .pc2:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(15, 18, 40, .4); border-color: color-mix(in srgb, var(--stc, var(--pj)) 45%, var(--border)); }
.pj-pro .pc2.dragging { opacity: .5; transform: rotate(1.5deg); }
.pj-pro .pc2-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 14px; }
.pj-pro .pc2-sub { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-pro .pc2-risk { font-size: .85rem; flex: none; }
.pj-pro .pc2 h4 { margin: 0; font-size: .88rem; font-weight: 650; line-height: 1.3; }
.pj-pro .pc2-money { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pj-pro .pc2-money b { font-size: 1.05rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pj-pro .pc2-money small { font-size: .68rem; color: var(--muted); }
.pj-pro .pc2-prog { display: flex; align-items: center; gap: 8px; }
.pj-pro .pc2-bar { flex: 1; height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--stc, var(--pj)) 14%, transparent); overflow: hidden; }
.pj-pro .pc2-bar i { display: block; height: 100%; border-radius: inherit; background: var(--stc, var(--pj)); }
.pj-pro .pc2-prog span { font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pj-pro .pc2-spent { font-size: .68rem; color: var(--muted); margin-top: -3px; }
.pj-pro .pc2-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--border); }
.pj-pro .pc2-pm { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: .72rem; font-weight: 600; }
.pj-pro .pc2-pm > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-pro .pc2-pm.none { color: var(--muted); font-weight: 500; font-style: italic; }
.pj-pro .pc2-pm .av { width: 22px; height: 22px; font-size: .55rem; flex: none; }
.pj-pro .pc2-right { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.pj-pro .pc2-docs { font-size: .68rem; color: var(--muted); }
.pj-pro .pc2-due { padding: 2px 7px; border-radius: 999px; background: var(--bg-alt); font-size: .66rem; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pj-pro .pc2-due.warn { background: #fff4d6; color: #9a6700; }
.pj-pro .pc2-due.late { background: #fde2e2; color: #b42318; }
.pj-pro .pc2-due.ok { background: #dcfce7; color: #15803d; }
.pj-pro .pc2-due.none { font-weight: 500; }
:root[data-theme="dark"] .pj-pro .pc2-due.warn { background: #3d2f05; color: #fcd34d; }
:root[data-theme="dark"] .pj-pro .pc2-due.late { background: #4a1414; color: #fca5a5; }
:root[data-theme="dark"] .pj-pro .pc2-due.ok { background: #0f3d26; color: #86efac; }

/* ===== Tabla de proyectos agrupada por etapa (projects.js: renderPTable) ===== */
.pj-pro .table-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pj-pro .pjt-pro td { vertical-align: middle; }
.pj-pro .pjt-pro .pjt-row td:first-child { position: relative; padding-left: 16px; }
.pj-pro .pjt-pro .pjt-row td:first-child::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--border); }
.pj-pro .pjt-pro .pjt-row.pr-alta td:first-child::before { background: #ef4444; }
.pj-pro .pjt-pro .pjt-row.pr-media td:first-child::before { background: #f59e0b; }
.pj-pro .pjt-pro .pjt-row.pr-baja td:first-child::before { background: #10b981; }
.pj-pro .pjt-pro .t-title b { display: block; font-weight: 600; font-size: .84rem; }
.pj-pro .pjt-pro .t-title small { display: block; margin-top: 2px; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pj-pro .pjt-pro .owner-cell { gap: 7px; font-size: .8rem; }
.pj-pro .pjt-pro .pc2-prog { min-width: 110px; }
.pj-pro .pjt-pro tr.pjt-group td { padding: 14px 12px 6px 14px; background: color-mix(in srgb, var(--stc) 6%, var(--surface)); border-bottom: 2px solid var(--stc); }
.pj-pro .pjt-pro tr.pjt-group .count { margin-left: 8px; background: color-mix(in srgb, var(--stc) 16%, transparent); font-weight: 700; }
.pj-pro .pjt-pro tr.pjt-group:hover td { background: color-mix(in srgb, var(--stc) 6%, var(--surface)); }
.pj-pro .pjt-gsum { float: right; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pj-pro .pjt-dev { font-weight: 600; color: var(--muted); }
.pj-pro .pjt-dev.over { color: #b42318; }
.pj-pro .pjt-alerts { white-space: nowrap; }
.pj-pro .pjt-alerts .pc2-risk + .pc2-risk { margin-left: 4px; }

/* Montos en UF (projects.js: curSeg / crm.js: dealUfHint) */
.cur-pick { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 8px; }
.cur-seg button { padding: 4px 12px; font-size: .78rem; }
.cur-seg button:disabled { opacity: .45; cursor: not-allowed; }
.uf-sub { display: block; color: var(--muted); font-size: .72rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.pc-money .uf-sub { display: inline; margin-left: 6px; }
.uf-hint { display: block; margin-top: 4px; color: var(--muted); font-size: .74rem; }

/* ===== Mejora continua: ficha y formulario profesionales (improvements.js) ===== */
#genDialog:has(.imp-pro), #genDialog.imp-wide { width: min(1180px, 100vw - 48px); max-height: calc(100vh - 32px); }
#genDialog.imp-wide .pd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#genDialog.imp-wide .pd-grid label.span2 { grid-column: 1 / -1; }
.imp-pro .imp-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.imp-pro .imp-title h3 { margin: 0; }
.imp-pro .imp-code { padding: 3px 9px; border-radius: 8px; background: color-mix(in srgb, #4f46e5 12%, transparent); color: #4f46e5; font-size: .74rem; font-weight: 800; letter-spacing: .03em; }
:root[data-theme="dark"] .imp-pro .imp-code { color: #a5b4fc; }
.imp-pro .imp-kpis { display: flex; flex-wrap: wrap; margin: 12px 0 4px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.imp-pro .imp-kpis > div { flex: 1 1 150px; display: grid; align-content: start; gap: 3px; padding: 10px 14px; border-right: 1px solid var(--border); }
.imp-pro .imp-kpis > div:last-child { border-right: 0; }
.imp-pro .imp-kpis small { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.imp-pro .imp-kpis b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.imp-pro .imp-bar { display: block; height: 5px; border-radius: 99px; background: color-mix(in srgb, #4f46e5 12%, transparent); overflow: hidden; margin-top: 2px; }
.imp-pro .imp-bar i { display: block; height: 100%; background: #4f46e5; border-radius: inherit; }
.imp-pro .imp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; margin-top: 8px; }
.imp-pro .imp-main > .pd-sec:first-child { border-top: 0; }
.imp-pro .imp-main h4 { font-size: .86rem; }
.imp-pro .imp-side { position: sticky; top: 0; display: grid; gap: 12px; }
.imp-pro .imp-facts { display: grid; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-alt); overflow: hidden; }
.imp-pro .imp-fact { display: grid; gap: 2px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.imp-pro .imp-fact:last-child { border-bottom: 0; }
.imp-pro .imp-fact small { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.imp-pro .imp-fact span { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; }
.imp-pro .imp-side #impFiles { margin: 0; padding-top: 0; border-top: 0; }
.imp-pro .imp-side #impFiles .dropzone { padding: 14px; font-size: .74rem; }
@media (max-width: 960px) { .imp-pro .imp-layout { grid-template-columns: 1fr; } .imp-pro .imp-side { position: static; } #genDialog.imp-wide .pd-grid { grid-template-columns: 1fr 1fr; } }
.imp-pro .imp-kpis small.uf-sub { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .72rem; }

/* Mejora continua: precio al cliente y estado de cobro (improvements.js) */
.bill-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--bg-alt); color: var(--muted); font-size: .66rem; font-weight: 700; white-space: nowrap; }
.bill-chip.b-cotizada { background: #e0f2fe; color: #0369a1; }
.bill-chip.b-oc { background: #ede9fe; color: #5b21b6; }
.bill-chip.b-facturada { background: #fff4d6; color: #9a6700; }
.bill-chip.b-pagada { background: #dcfce7; color: #15803d; }
:root[data-theme="dark"] .bill-chip.b-cotizada { background: #0c3a57; color: #bae6fd; }
:root[data-theme="dark"] .bill-chip.b-oc { background: #2e1065; color: #c4b5fd; }
:root[data-theme="dark"] .bill-chip.b-facturada { background: #3d2f05; color: #fcd34d; }
:root[data-theme="dark"] .bill-chip.b-pagada { background: #0f3d26; color: #86efac; }
.imp-pro .imp-kpis .bill-chip { justify-self: start; margin-top: 2px; }
.imp-pro .imp-kpis .neg { color: #b42318; }
.imp-card .imp-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.imp-card .imp-price b { font-size: .95rem; font-variant-numeric: tabular-nums; }
.imp-card .imp-price small { color: var(--muted); font-size: .7rem; }

/* Mejora continua › Costos (improvements.js: impCostsHtml) */
.ic-wrap { display: grid; gap: 12px; }
.ic-kpis { display: flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.ic-kpis > div { flex: 1 1 150px; display: grid; gap: 2px; padding: 12px 16px; border-right: 1px solid var(--border); }
.ic-kpis > div:last-child { border-right: 0; }
.ic-kpis small { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ic-kpis b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.ic-kpis span { font-size: .72rem; color: var(--muted); }
.ic-kpis .warn b { color: #b45309; }
.ic-kpis .ok b { color: #15803d; }
.ic-kpis .neg b, .ic-wrap .neg { color: #b42318; }
.ic-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; align-items: start; }
.ic-card { padding: 14px 16px; border-radius: 14px; }
.ic-card h3 { margin: 0 0 2px; font-size: .9rem; }
.ic-states { display: grid; gap: 10px; margin: 12px 0 8px; }
.ic-st { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l v" "t t"; gap: 4px 10px; align-items: center; }
.ic-st > span { grid-area: l; display: inline-flex; align-items: center; gap: 6px; }
.ic-st > span small { color: var(--muted); font-size: .72rem; }
.ic-st > b { grid-area: v; font-size: .82rem; font-variant-numeric: tabular-nums; }
.ic-track { grid-area: t; height: 6px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; }
.ic-track i { display: block; height: 100%; border-radius: inherit; background: #94a3b8; }
.ic-track i.b-cotizada { background: #0ea5e9; }
.ic-track i.b-oc { background: #7c3aed; }
.ic-track i.b-facturada { background: #f59e0b; }
.ic-track i.b-pagada { background: #16a34a; }
.ic-table .table-wrap { margin-top: 10px; }
.ic-table .ptable { font-size: .82rem; }
.ic-table .ptable td { padding: 8px 10px; }
.ic-table .ptable td.num { font-variant-numeric: tabular-nums; }
.ic-table .t-title small { display: block; margin-top: 1px; font-size: .7rem; }
.ic-table tr[data-imp-id] { cursor: pointer; }
.ic-table tr.ic-done td { color: var(--muted); }
@media (max-width: 980px) { .ic-grid { grid-template-columns: 1fr; } }

/* Logo de la empresa en la barra lateral (tenants.js) */
.tenant-ico .tenant-logo, .tenant-logo-btn .tenant-logo { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; background: #fff; display: block; }
.tenant-initial { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--primary); color: #fff; font-size: .8rem; font-weight: 800; }
.tenant-logo-btn { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 7px; }
.tenant-logo-btn:hover::after { content: "✎"; position: absolute; right: -5px; bottom: -5px; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--text); font-size: .6rem; box-shadow: 0 1px 3px rgba(0,0,0,.25); }

/* ===== Barra lateral: íconos de línea y modo contraído (sidebar.js) ===== */
@media (min-width: 861px) { .sidebar { position: sticky; } }      /* en el teléfono es un menú lateral que se abre con ☰ */
.sidebar .side-btn { gap: 11px; }
.sb-ic { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; opacity: .85; }
.side-btn.active .sb-ic { opacity: 1; }
.sb-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Botón redondo sobre el borde de la barra lateral (posición horizontal la fija sidebar.js) */
.sb-toggle { position: fixed; top: 30px; left: 211px; z-index: 60; display: grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--line, #e5e7eb); border-radius: 50%; background: var(--surface, #fff); color: var(--muted); cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .12); transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s, transform .15s; }
.sb-toggle svg { width: 15px; height: 15px; stroke-width: 2.2; }
.sb-toggle:hover { background: #2563eb; border-color: #2563eb; color: #fff; box-shadow: 0 4px 12px -2px rgba(37, 99, 235, .45); }
.sb-toggle:active { transform: scale(.92); }
.sb-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
@media (max-width: 860px) { .sb-toggle { display: none; } }
.qk-open .sb-ic { width: 18px; height: 18px; }
@media (min-width: 861px) {
  body.app.sb-collapsed { grid-template-columns: 68px 1fr; }
  body.sb-collapsed .sidebar { padding-left: 10px; padding-right: 10px; overflow-x: hidden; }
  body.sb-collapsed .sidebar .brand { justify-content: center; padding: 0 0 4px; }
  body.sb-collapsed .sidebar .brand > span:not(.logo) { display: none; }
  body.sb-collapsed .sb-label, body.sb-collapsed .qk-open > span:nth-child(2), body.sb-collapsed .qk-open kbd { display: none; }
  body.sb-collapsed .qk-open { width: 44px; margin: 0 auto 8px; justify-content: center; padding: 8px 0; }
  body.sb-collapsed .ws-name { height: 1px; padding: 0; margin: 8px 6px; overflow: hidden; color: transparent; background: var(--border); }
  body.sb-collapsed .side-btn { position: relative; justify-content: center; padding: 9px 0; }
  body.sb-collapsed .side-btn .count { position: absolute; top: 2px; right: 4px; margin: 0; padding: 0 5px; font-size: .6rem; min-width: 16px; }
  body.sb-collapsed .tenant-box { margin: 0 0 8px; }
  body.sb-collapsed .tenant-pick { justify-content: center; padding: 6px 0; }
  body.sb-collapsed .tenant-pick > :not(.tenant-ico) { display: none; }
  body.sb-collapsed .support-banner { display: none; }
  body.sb-collapsed .side-molly { justify-content: center; padding: 8px 0; }
  body.sb-collapsed .side-molly > span:not(.molly-avatar) { display: none; }
  body.sb-collapsed .side-foot .me { justify-content: center; }
  body.sb-collapsed .side-foot .me > :not(.av) { display: none; }
  body.sb-collapsed .side-more { display: none; }
}
.sidebar .side-nav { overflow-x: hidden; }
/* Logo alargado de la empresa en lugar del nombre (tenants.js: has-logo) */
.tenant-pick.has-logo { position: relative; justify-content: center; padding: 6px 10px; min-height: 56px; background: #fff; }
.tenant-pick.has-logo .tenant-wordmark { display: block; width: 100%; max-width: 100%; height: 44px; object-fit: contain; }
.tenant-pick.has-logo .tenant-overlay { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0 10px; opacity: 1; color: transparent; cursor: pointer;
  appearance: none; -webkit-appearance: none; background: transparent; }
.tenant-pick.has-logo .tenant-overlay option, .tenant-pick.has-logo .tenant-overlay optgroup { color: var(--text); background: var(--surface); }
.tenant-pick.has-logo:has(.tenant-overlay)::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.tenant-pick.has-logo:has(.tenant-overlay) .tenant-wordmark { margin-right: 18px; }
.tenant-edit { position: absolute; top: -7px; right: -7px; z-index: 2; display: none; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--border);
  border-radius: 50%; background: var(--surface); color: var(--text); font-size: .7rem; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.tenant-pick.has-logo:hover .tenant-edit { display: grid; }
@media (min-width: 861px) {
  body.sb-collapsed .tenant-pick.has-logo { padding: 4px; min-height: 40px; }
  body.sb-collapsed .tenant-pick.has-logo > .tenant-wordmark { display: block; height: 30px; margin: 0; }
  body.sb-collapsed .tenant-pick.has-logo::after, body.sb-collapsed .tenant-edit { display: none !important; }
}

/* Etiqueta PRO en ERP, Flota y Cartolas (sidebar.js) */
.sb-pro { margin-left: auto; padding: 1px 6px; border-radius: 999px; background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff;
  font-size: .56rem; font-weight: 800; letter-spacing: .06em; line-height: 1.5; flex: none; }
@media (min-width: 861px) {
  body.sb-collapsed .sb-pro { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; padding: 0; font-size: 0; }
}

/* ===================== Dashboard (Vista general) — personal.js ===================== */
.dash { display: grid; gap: 16px; margin-top: 6px; }
.dk-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dk-card { display: grid; gap: 8px; padding: 18px 18px 16px; border: 1px solid var(--dk-line, #eceef3);
  border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); font: inherit; color: inherit; text-align: left; cursor: pointer;
  transition: box-shadow .15s, transform .15s; min-width: 0; }
.dk-card:hover { box-shadow: 0 10px 24px -14px rgba(16, 24, 40, .25); transform: translateY(-1px); }
.dk-main { display: grid; gap: 6px; min-width: 0; }
.dk-label { font-size: .86rem; font-weight: 600; color: var(--muted); }
.dk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dk-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #eaf1ff; color: #2563eb; flex: none; }
.dk-card[data-kpi="late"] .dk-ico { background: #fde2e4; color: #dc2626; }
.dk-card small { color: var(--muted); font-size: .76rem; }
.dk-label i, .dk-head h3 i { font-style: normal; color: var(--muted); font-weight: 500; font-size: .78rem; }
.dk-value { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dk-main small { color: var(--muted); font-size: .74rem; }
.dk-chip { padding: 2px 8px; border-radius: 6px; font-size: .7rem; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.dk-chip.up { background: #dcfce7; color: #15803d; }
.dk-chip.down { background: #fde2e4; color: #c0263b; }
.dk-chip.warn { background: #fff4d6; color: #9a6700; }
.dk-chip.flat { background: var(--bg-alt); color: var(--muted); }
.dk-chart { flex: none; }
.dk-chart svg { display: block; }
.dk-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); gap: 16px; align-items: stretch; }
.dk-panel { padding: 18px 20px; border: 1px solid var(--dk-line, #eceef3); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); min-width: 0; }
.dk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dk-head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.dk-range { display: inline-flex; gap: 6px; }
.dk-range button { padding: 4px 10px; border: 1px solid var(--dk-line, #e5e7ee); border-radius: 8px; background: var(--surface); color: var(--muted); font: inherit; font-size: .74rem; cursor: pointer; }
.dk-range button.on { background: #3b82f6; border-color: #3b82f6; color: #fff; font-weight: 600; }
.dk-line svg { display: block; }
.dk-grid-l { stroke: var(--dk-line, #eef0f4); }
.dk-grid-v { stroke: var(--dk-line, #f2f3f7); stroke-dasharray: 3 4; }
.dk-ax { font-size: 11px; fill: var(--muted); }
.dk-ax.cur { font-weight: 700; fill: var(--text); }
.dk-pt { fill: #fff; stroke: #3b82f6; stroke-width: 2.2; }
.dk-pt.last { fill: #3b82f6; }
.dk-panel .act-list { max-height: 260px; overflow-y: auto; }
/* Productividad: total + gráfico comparativo con tooltip */
.dk-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.dk-prod { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.dk-prod-total { display: grid; gap: 8px; align-content: start; }
.dk-prod-total h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.dk-prod-total .dk-range { margin: 4px 0 10px; }
.dk-prod-total b { font-size: 2.3rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.dk-prod-total #dkTotalChip { display: block; }
.dk-prod-total small { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.dk-line { position: relative; }
.dk-prev { fill: none; stroke: #a3abbd; stroke-width: 1.8; stroke-dasharray: 5 5; }
.dk-cursor { stroke: #2563eb; stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; }
.dk-dot { fill: #fff; stroke: #2563eb; stroke-width: 3; }
.dk-tip { position: absolute; z-index: 3; display: grid; gap: 3px; min-width: 150px; padding: 9px 12px; border-radius: 10px; background: #111827; color: #fff;
  font-size: .76rem; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .45); pointer-events: none; }
.dk-tip > b { font-size: .78rem; margin-bottom: 2px; }
.dk-tip span { display: flex; align-items: center; gap: 6px; color: #d1d5db; }
.dk-tip span b { color: #fff; }
.dk-tip i { width: 10px; height: 3px; border-radius: 2px; background: #3b82f6; }
.dk-tip i.prev { background: #a3abbd; }
.dk-seg-wrap { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--dk-line, #eceef3); }
.dk-seg-wrap h4 { margin: 0; font-size: .9rem; font-weight: 700; }
.dk-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dk-seg-item { display: grid; gap: 4px; padding: 10px 14px; border-left: 3px solid var(--c); border-radius: 4px 10px 10px 4px; background: color-mix(in srgb, var(--c) 6%, transparent); }
.dk-seg-item b { display: flex; align-items: center; gap: 8px; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dk-seg-item b span { font-size: 1rem; }
.dk-seg-item small { color: var(--muted); font-size: .76rem; }
/* Día más activo: barras por día de la semana */
.dk-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 170px; align-items: end; padding-top: 8px; }
.dk-dow-col { position: relative; display: grid; grid-template-rows: 1fr auto; justify-items: center; height: 100%; gap: 6px; }
.dk-dow-col span { align-self: end; width: 100%; max-width: 34px; border-radius: 8px; background: #e7eaf0; transform-origin: bottom; }
.dk-dow-col.top span { background: #2563eb; }
.dk-dow-col small { font-size: .74rem; color: var(--muted); }
.dk-dow-col.top small { color: #2563eb; font-weight: 700; }
.dk-dow-col em { position: absolute; top: -4px; font-style: normal; font-size: .72rem; font-weight: 700; color: #fff; background: #111827; padding: 1px 7px; border-radius: 6px; }
:root[data-theme="dark"] .dk-dow-col span { background: #2b3160; }
:root[data-theme="dark"] .dk-ico { background: #1e2a55; color: #93b4ff; }
@media (max-width: 1100px) { .dk-prod { grid-template-columns: 1fr; } .dk-seg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dk-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.dk-table thead th { padding: 10px 12px; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: left; border-bottom: 1px solid var(--dk-line, #eceef3); background: none; }
.dk-table td { padding: 12px; border-bottom: 1px solid var(--dk-line, #f1f2f6); vertical-align: middle; }
.dk-table tbody tr { cursor: pointer; }
.dk-table tbody tr:hover td { background: var(--bg-alt); }
.dk-table tbody tr:last-child td { border-bottom: 0; }
.dk-table .t-title b { display: block; font-weight: 600; }
.dk-table .t-title small { display: block; margin-top: 2px; color: var(--muted); font-size: .72rem; }
.dk-who { display: inline-flex; align-items: center; gap: 8px; }
.dk-who .av { width: 24px; height: 24px; font-size: .58rem; }
.dk-src { font-size: .78rem; color: var(--muted); }
.dk-st { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.dk-st.st-todo { background: #eef2ff; color: #4338ca; }
.dk-st.st-doing { background: #fff4e5; color: #b45309; }
.dk-st.st-done { background: #dcfce7; color: #15803d; }
.dk-st.st-late { background: #fde2e4; color: #c0263b; }
.dk-more { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dk-more .panel { padding: 16px 18px; border-radius: 14px; }
.dk-more .panel-head h3 { font-size: 1rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.dk-more .act-list { max-height: 280px; overflow-y: auto; }
:root[data-theme="dark"] .dash { --dk-line: #343b6b; }
:root[data-theme="dark"] .dk-chip.up, :root[data-theme="dark"] .dk-st.st-done { background: #0f3d26; color: #86efac; }
:root[data-theme="dark"] .dk-chip.down, :root[data-theme="dark"] .dk-st.st-late { background: #4a1414; color: #fca5a5; }
:root[data-theme="dark"] .dk-st.st-todo { background: #24264a; color: #c7d2fe; }
:root[data-theme="dark"] .dk-st.st-doing, :root[data-theme="dark"] .dk-chip.warn { background: #3d2f05; color: #fcd34d; }
@media (max-width: 1250px) { .dk-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dk-more { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .dk-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .dk-row, .dk-more { grid-template-columns: 1fr; } }

/* ===================== Marco del sitio (estilo claro): barra blanca, acento azul, fondo gris suave ===================== */
:root:not([data-theme="dark"]) body.app { --bg: #f5f7fb; background: #f5f7fb; }
:root:not([data-theme="dark"]) .sidebar { background: #fff !important; border-right: 1px solid #eceef3; }
body.app .sidebar .side-btn { color: #3f4660; font-weight: 500; border-radius: 10px; }
body.app .sidebar .side-btn .sb-ic { color: #5b6280; }
body.app .sidebar .side-btn:hover { background: #f3f5fa; color: #111827; }
body.app .sidebar .side-btn.active { background: #eaf1ff; color: #2563eb; font-weight: 600; box-shadow: none; position: relative; }
body.app .sidebar .side-btn.active .sb-ic { color: #2563eb; }
body.app .sidebar .side-btn.active::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: #2563eb; }
body.app .sidebar .side-btn .count { background: #e8f8ef; color: #15803d; font-weight: 700; }
.sidebar .ws-name { color: #9aa1b5 !important; }
:root[data-theme="dark"] body.app .sidebar .side-btn { color: #c3c7e6; }
:root[data-theme="dark"] body.app .sidebar .side-btn .sb-ic { color: #a7add0; }
:root[data-theme="dark"] body.app .sidebar .side-btn.active { background: #24264a; color: #93b4ff; }
:root:not([data-theme="dark"]) .topbar { background: #fff; backdrop-filter: none; border-bottom: 1px solid #eceef3; }
:root:not([data-theme="dark"]) .panel, :root:not([data-theme="dark"]) .stat { border-color: #eceef3; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.dash .dk-table td { padding: 9px 12px; }
.dash .dk-table .t-title small { margin-top: 1px; }

/* ===================== Movimiento (sidebar.js: animateView, ripple, contadores) ===================== */
@keyframes kxViewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes kxCardIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes kxDlgIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes kxRipple { from { transform: scale(0); opacity: .35; } to { transform: scale(2.6); opacity: 0; } }
@keyframes kxDraw { from { stroke-dashoffset: var(--len, 1200); } to { stroke-dashoffset: 0; } }
@keyframes kxGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: no-preference) {
  .view-enter { animation: kxViewIn .38s cubic-bezier(.2, .75, .25, 1) both; }
  .view-enter :is(.dk-row, .dk-grid, .kpis, .kanban, .act-grid, .ca-row, .dk-more) > * { animation: kxCardIn .45s cubic-bezier(.2, .75, .25, 1) both; }
  .view-enter :is(.dk-row, .dk-grid, .kpis, .kanban, .act-grid, .ca-row, .dk-more) > :nth-child(2) { animation-delay: .05s; }
  .view-enter :is(.dk-row, .dk-grid, .kpis, .kanban, .act-grid, .ca-row, .dk-more) > :nth-child(3) { animation-delay: .1s; }
  .view-enter :is(.dk-row, .dk-grid, .kpis, .kanban, .act-grid, .ca-row, .dk-more) > :nth-child(4) { animation-delay: .15s; }
  .view-enter :is(.dk-row, .dk-grid, .kpis, .kanban, .act-grid, .ca-row, .dk-more) > :nth-child(n+5) { animation-delay: .2s; }
  .view-enter .dk-line path[stroke] { stroke-dasharray: var(--len, 1200); animation: kxDraw 1s .15s ease-out both; }
  .view-enter .dk-chart rect { transform-box: fill-box; transform-origin: bottom; animation: kxGrow .6s .2s cubic-bezier(.2, .75, .25, 1) both; }
  .view-enter .dk-dow-col span { animation: kxGrow .6s .2s cubic-bezier(.2, .75, .25, 1) both; }
  dialog[open] { animation: kxDlgIn .2s cubic-bezier(.2, .75, .25, 1); }
  /* Botones: se hunden al presionar y se levantan al pasar el mouse */
  .btn, .seg button, .icon-btn, .side-btn, .dk-range button, .chan, .ochip, .qk-open { transition: transform .14s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease; }
  .btn:active, .seg button:active, .icon-btn:active, .dk-range button:active, .ochip:active, .chan:active { transform: scale(.96); }
  .side-btn:active { transform: scale(.98); }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--primary) 80%, transparent); }
  .side-btn .sb-ic { transition: transform .18s ease; }
  .side-btn:hover .sb-ic { transform: translateX(2px); }
  .tcard, .pcard, .act-item, .dk-card, .ent-item, .ca-deal, .pg-item, .mini-row { transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease; }
  .tcard:hover, .act-item:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -16px rgba(16, 24, 40, .35); }
  .stat, .panel { transition: box-shadow .2s ease, transform .2s ease; }
}
/* Onda al presionar */
.kx-ripple-layer { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; z-index: 0; }
@media (prefers-reduced-motion: no-preference) {
  /* Pulsación en todos los botones y pestañas del sitio */
  button:not(:disabled), .btn, [role=tab] { transition: transform .14s ease, background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease; }
  button:not(:disabled):active, .btn:active, [role=tab]:active { transform: scale(.96); }
  .sidebar .side-btn:active { transform: scale(.98); }
  /* Pestañas con subrayado (Origen, filtros, vistas): el subrayado aparece deslizándose */
  .ochip.on, .seg button.on, .tabs .on, [role=tab][aria-selected=true] { animation: kxTabOn .28s cubic-bezier(.2, .75, .25, 1); }
}
@keyframes kxTabOn { from { border-bottom-color: transparent; box-shadow: inset 0 -2px 0 transparent; } }
.sidebar .side-btn, .sidebar .side-nav > * { flex-shrink: 0; }
.kx-ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; animation: kxRipple .55s ease-out forwards; }
.dash .dk-table td { line-height: 1.3; } .dash .dk-table .prio, .dash .dk-table .dk-st { white-space: nowrap; vertical-align: middle; }

/* ===================== Carta Gantt pro: salud del plan, escala, filas alineadas, dependencias y arrastre ===================== */
#pGantt { position: relative; }
#pGantt .g-head { flex-wrap: wrap; gap: 10px; }
#pGantt .g-head .row-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.g-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--bg-alt); border: 1px solid var(--line); }
.g-seg button { border: 0; background: none; padding: 4px 11px; border-radius: 7px; font: inherit; font-size: .76rem; color: var(--muted); cursor: pointer; }
.g-seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
/* Resumen */
.g-sum { display: grid; grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr)); gap: 12px; margin: 4px 0 16px; }
.g-sum-card { display: grid; gap: 3px; align-content: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.g-sum-card small { font-size: .72rem; color: var(--muted); font-weight: 600; }
.g-sum-card b { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.g-sum-card b i { font-style: normal; color: var(--muted); font-weight: 400; }
.g-sum-card > span { font-size: .74rem; }
.g-sum-card.is-late { border-color: color-mix(in srgb, #ef4444 40%, var(--line)); background: color-mix(in srgb, #ef4444 5%, var(--surface)); }
.g-sum-card.is-late b { color: #dc2626; }
.g-sum-main { grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
.g-sum-main > div { display: grid; gap: 2px; }
.g-sum-main b { font-size: 1.5rem; }
.g-ring .bg { fill: none; stroke: var(--bg-alt); stroke-width: 7; }
.g-ring .fg { fill: none; stroke-width: 7; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .8s cubic-bezier(.2, .75, .25, 1); }
.g-ring text { font-size: 13px; font-weight: 700; fill: var(--text); }
.g-health.ok { color: #16a34a; } .g-health.risk { color: #d97706; } .g-health.late { color: #dc2626; } .g-health.paused { color: var(--muted); }
.g-ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Lienzo con desplazamiento horizontal y nombres fijos a la izquierda */
#pGantt .g-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 14px; }
#pGantt .g-canvas { --lw: 270px; position: relative; display: grid; gap: 0; width: max-content; min-width: 100%; margin: 0; padding-bottom: 6px; }
#pGantt .g-line { grid-template-columns: var(--lw) var(--tw); gap: 0; align-items: stretch; }
#pGantt .g-label { position: sticky; left: 0; z-index: 4; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 10px; background: var(--surface); border-right: 1px solid var(--line); font-size: .8rem; min-width: 0; }
#pGantt .g-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
#pGantt .g-tog { width: 18px; flex: none; font-size: 1rem; line-height: 1; color: var(--muted); }
#pGantt .g-lp { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--muted); flex: none; }
#pGantt .g-line.phase .g-label { font-weight: 600; }
#pGantt .g-line.item .g-label { padding-left: 30px; font-size: .76rem; color: var(--muted); font-weight: 400; }
#pGantt .g-st { flex: none; width: 14px; color: var(--pc); }
#pGantt .g-line.late .g-name { color: #dc2626; }
#pGantt .g-track { position: relative; height: 40px; background: transparent; border-radius: 0; }
#pGantt .g-line.item .g-track { height: 30px; }
#pGantt .g-line.phase { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
#pGantt .g-line.phase:hover .g-label, #pGantt .g-line.item:hover .g-label { background: color-mix(in srgb, var(--pc) 6%, var(--surface)); }
#pGantt .g-line:not(.g-header):hover .g-track { background: color-mix(in srgb, var(--pc) 4%, transparent); }
/* Encabezado: meses y semanas */
#pGantt .g-header { position: relative; z-index: 5; }
#pGantt .g-header .g-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
#pGantt .g-months { height: 30px; border-bottom: 1px solid var(--line); background: var(--surface); }
#pGantt .g-months span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding-left: 8px; border-left: 1px solid var(--line); font-size: .74rem; font-weight: 600; color: var(--text); text-transform: capitalize; white-space: nowrap; overflow: hidden; }
#pGantt .g-weeks { height: 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
#pGantt .g-weeks span { position: absolute; top: 4px; font-size: .66rem; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
/* Fondo: líneas de mes, fines de semana, hoy y término */
#pGantt .g-overlay { position: absolute; top: 0; bottom: 0; left: var(--lw); right: 0; pointer-events: none; z-index: 1; }
#pGantt .g-mline { position: absolute; top: 30px; bottom: 0; width: 1px; background: color-mix(in srgb, var(--text) 8%, transparent); }
#pGantt .g-wend { position: absolute; top: 30px; bottom: 0; background: color-mix(in srgb, var(--text) 3.5%, transparent); }
#pGantt .g-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #ef4444; opacity: 1; box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); z-index: 3; }
#pGantt .g-tag { position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 2; padding: 1px 8px; border-radius: 999px; font-size: .64rem; font-weight: 800; color: #fff; background: #ef4444; white-space: nowrap; }
#pGantt .g-tag.end { background: #111827; }
:root[data-theme="dark"] #pGantt .g-tag.end { background: #e5e7eb; color: #111827; }
#pGantt .g-endline { position: absolute; top: 0; bottom: 0; border-left: 2px dashed #111827; opacity: .55; }
/* Barras */
#pGantt .g-bar { top: 9px; height: 22px; border-radius: 7px; z-index: 2; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); transition: box-shadow .15s, filter .15s; }
#pGantt .g-bar.thin { top: 8px; height: 14px; border-radius: 5px; }
#pGantt .g-bar em { top: 3px; right: 6px; font-size: .68rem; }
#pGantt .g-bar:hover { box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--pc) 70%, transparent); filter: saturate(1.15); }
#pGantt .g-bar.can-drag { cursor: grab; touch-action: none; }
#pGantt .g-bar.dragging { cursor: grabbing; z-index: 6; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--pc) 80%, transparent); outline: 2px solid var(--pc); outline-offset: 2px; }
#pGantt .g-h { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; }
#pGantt .g-h.l { left: 0; } #pGantt .g-h.r { right: 0; }
#pGantt .g-bar.can-drag:hover .g-h::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 3px; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--pc) 70%, #fff); }
#pGantt .g-who { position: absolute; top: 50%; transform: translate(6px, -50%); z-index: 2; }
#pGantt .g-who .av { width: 22px; height: 22px; font-size: .55rem; box-shadow: 0 0 0 2px var(--surface); }
#pGantt .g-line.item .g-who .av { width: 18px; height: 18px; font-size: .5rem; }
/* Dependencias */
#pGantt .g-deps { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; overflow: visible; }
#pGantt .g-dep { fill: none; stroke: color-mix(in srgb, var(--text) 35%, transparent); stroke-width: 1.4; stroke-linejoin: round; }
#pGantt .g-dep-head { fill: color-mix(in srgb, var(--text) 45%, transparent); }
.lg-dep { width: 22px; height: 0; border-top: 1.5px solid color-mix(in srgb, var(--text) 40%, transparent); border-radius: 0; }
/* Ficha emergente */
#pGantt .g-tip { position: absolute; z-index: 20; display: grid; gap: 4px; min-width: 220px; max-width: 320px; padding: 10px 12px; border-radius: 12px; background: #111827; color: #e5e7eb; font-size: .76rem; box-shadow: 0 16px 32px -12px rgba(0, 0, 0, .5); pointer-events: none; }
#pGantt .g-tip[hidden] { display: none; }
#pGantt .g-tip > b { color: #fff; font-size: .84rem; }
#pGantt .g-tip small { color: #9ca3af; }
#pGantt .g-tip em { color: #fca5a5; font-style: normal; font-weight: 600; }
#pGantt .g-tip-bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: 3px; }
#pGantt .g-tip-bar i { display: block; height: 100%; border-radius: 3px; }
/* Tabla de edición más limpia */
#pGantt .g-table { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
#pGantt .g-table .g-header { font-size: .68rem; padding: 0 6px 6px; border-bottom: 1px solid var(--line); }
.pd-full #pGantt .g-canvas { --lw: 320px; }
:root[data-theme="dark"] #pGantt .g-endline { border-left-color: #e5e7eb; }
@media (max-width: 1100px) { .g-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-sum-main { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: no-preference) {
  #pGantt .g-anim .g-bar { animation: gGrow .55s cubic-bezier(.2, .75, .25, 1) both; transform-origin: left; }
  #pGantt .g-anim .g-dep { stroke-dasharray: 2000; animation: gDraw 1.2s .25s ease-out both; }
}
@keyframes gGrow { from { transform: scaleX(0); opacity: 0; } }
@keyframes gDraw { from { stroke-dashoffset: 2000; } to { stroke-dashoffset: 0; } }

/* Mientras carga, el menú no se muestra con los emojis antiguos (sidebar.js le pone los íconos y quita la clase) */
body.sb-pending #sidebar .side-nav, body.sb-pending #sidebar .side-more, body.sb-pending #sidebar .qk-open, body.sb-pending #sidebar .side-foot .side-btn { visibility: hidden; }

/* Lynx se abre desde la esquina inferior de la barra lateral; el botón de la barra superior no se muestra */
#openMolly { display: none !important; }

/* Reloj de jornada en la barra superior (solo mientras está en curso) */
#workdayBtn[hidden] { display: none !important; }
#workdayBtn.running { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
#workdayBtn .wd-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); animation: wdPulse 1.6s ease-in-out infinite; }
@keyframes wdPulse { 50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); } }
:root[data-theme="dark"] #workdayBtn.running { background: #0f3d26; border-color: #166534; color: #86efac; }

/* Vista general: compañeros ausentes (Talana, BUK, vacaciones, Outlook) */
.dk-abs-list { display: grid; gap: 4px; }
.dk-abs-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 10px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.dk-abs-row:hover { background: var(--bg-alt); }
.dk-abs-row .av { flex: none; }
.dk-abs-who { display: grid; min-width: 0; flex: 1; }
.dk-abs-who b { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-abs-who small { font-size: .72rem; color: var(--muted); }
.dk-abs-when { flex: none; font-size: .72rem; font-weight: 600; color: #b45309; background: #fff4d6; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.dk-abs-sub { margin: 12px 0 4px; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dk-abs-list + .link-btn { margin-top: 6px; }
:root[data-theme="dark"] .dk-abs-when { background: #3d2e0a; color: #fcd34d; }
/* Calendario: resumen de compañeros ausentes (solo Gerencia y jefatura) */
.absp-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 30px 60px -20px rgba(16, 24, 40, .45); }
.absp-dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.absp { display: grid; gap: 10px; padding: 22px 24px 20px; max-height: min(80vh, 720px); overflow: auto; }
.absp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.absp-head h3 { margin: 0 0 2px; font-size: 1.1rem; }
.absp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 4px 0; }
.absp-kpis div { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.absp-kpis b { font-size: 1.35rem; font-weight: 700; }
.absp-kpis small { font-size: .7rem; color: var(--muted); }
.absp h4 { margin: 8px 0 0; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.absp-list { display: grid; gap: 2px; }
.absp-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.absp-row:hover { background: var(--bg-alt); }
.absp-row .av { flex: none; }
.absp-who { display: grid; flex: 1; min-width: 0; }
.absp-who b { font-size: .86rem; font-weight: 600; }
.absp-who small { font-size: .72rem; color: var(--muted); }
.absp-when { flex: none; font-size: .72rem; font-weight: 600; color: #b45309; background: #fff4d6; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.absp .row-btns { justify-content: flex-end; margin-top: 6px; }
:root[data-theme="dark"] .absp-when { background: #3d2e0a; color: #fcd34d; }
@media (max-width: 560px) { .absp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Vacaciones por aprobar: ficha con el detalle para decidir */
.vac-bal-row .av, .vac-row .av, .vac-req .av { flex: none; }
.vac-req { display: grid; gap: 8px; padding: 12px; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.vac-req header { display: flex; align-items: center; gap: 10px; }
.vac-req header > div { display: grid; flex: 1; min-width: 0; }
.vac-req header b { font-size: .9rem; }
.vac-req header small { font-size: .72rem; color: var(--muted); }
.vac-req-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.vac-req-grid > div { display: grid; gap: 1px; padding: 8px; border-radius: 10px; background: var(--bg-alt); min-width: 0; }
.vac-req-grid small { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.vac-req-grid b { font-size: .82rem; }
.vac-req-grid span { font-size: .7rem; color: var(--muted); }
.vac-req-grid .bad { background: #fef2f2; } .vac-req-grid .bad b, .vac-req-grid .bad span { color: #b91c1c; }
.vac-req-note { margin: 0; font-size: .76rem; padding: 6px 9px; border-radius: 8px; background: var(--bg-alt); }
.vac-req-note.warn { background: #fff7e6; color: #92400e; } .vac-req-note.ok { background: #ecfdf3; color: #166534; }
.vac-req .row-btns { justify-content: flex-end; }
:root[data-theme="dark"] .vac-req-note.warn { background: #3d2e0a; color: #fcd34d; }
:root[data-theme="dark"] .vac-req-note.ok { background: #0f2e1d; color: #86efac; }
:root[data-theme="dark"] .vac-req-grid .bad { background: #3b1414; }
/* Próximas ausencias (calendario): nombre largo no se monta sobre las fechas */
.abs-row > span:first-child b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abs-row > span:last-child { flex: none; white-space: nowrap; margin-left: 8px; }
.abs-row > span:first-child { flex: 1; }

/* Talana: ficha en Mi Equipo y saldos informados */
.member-hr { display: grid; gap: 1px; font-size: .72rem; color: var(--muted); line-height: 1.35; }
.member-hr span:first-child { color: var(--text); font-weight: 500; }
.vac-bal-tl { font-size: .84rem; color: #15803d; white-space: nowrap; }

/* Calendario: «Ausentes hoy» y «Próximas ausencias» (nombre completo, tipo debajo y fecha a la derecha) */
.abs-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.abs-item .av { flex: none; }
.abs-item-txt { display: grid; flex: 1; min-width: 0; }
.abs-item-txt b { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abs-item-txt small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abs-item-when { flex: none; max-width: 46%; font-size: .72rem; font-weight: 600; color: var(--muted); text-align: right; line-height: 1.3; }
.abs-item-when.now { color: #b45309; background: #fff4d6; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
:root[data-theme="dark"] .abs-item-when.now { background: #3d2e0a; color: #fcd34d; }

/* Integraciones → Talana: personas visibles en KLOUSEN */
.tl-vis-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tl-vis-head h4 { margin: 0 0 2px; }
.tl-vis-count { flex: none; font-size: .78rem; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--bg-alt); }
.tl-vis-count b { color: var(--text); }
.tl-vis-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.tl-vis-tools .input { flex: 1; min-width: 200px; }
.tl-vis-table { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.tl-vis-table table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.tl-vis-table th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tl-vis-table td { padding: 7px 10px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.tl-vis-table tr.on td { background: color-mix(in srgb, #2563eb 5%, transparent); }
.tl-vis-table td:first-child, .tl-vis-table th:first-child { width: 34px; }
.tl-team { font-size: .66rem; font-weight: 700; color: #15803d; background: #dcfce7; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.vac-ext-h { margin: 12px 0 2px; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
:root[data-theme="dark"] .tl-team { background: #0f2e1d; color: #86efac; }

/* Calendario: panel lateral ordenado con pestañas «Mío» / «Mi equipo» */
.cal-side { align-content: start; }
.cal-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); position: sticky; top: 8px; z-index: 3; }
.cal-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border: 0; border-radius: 10px;
  background: none; font: inherit; font-size: .84rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.cal-tabs button:hover { color: var(--text); background: var(--bg-alt); }
.cal-tabs button.on { background: var(--text); color: var(--surface); }
.cal-tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .66rem; font-weight: 800; display: inline-grid; place-items: center; }
.cal-side .cal-card { border-radius: 16px; padding: 18px; }
.cal-side .cal-card .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-side .cal-card .panel-head h3 { font-size: .98rem; }
.abs-count { flex: none; min-width: 24px; padding: 2px 9px; border-radius: 999px; background: #fff4d6; color: #b45309; font-size: .74rem; font-weight: 700; text-align: center; line-height: 1.4; }
.cal-side .abs-item { padding: 8px; border-radius: 10px; border: 0; background: none; margin: 0; }
.cal-side .abs-item:hover { background: var(--bg-alt); }
.cal-side .abs-item + .abs-item { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); border-radius: 0; }
.cal-more { display: block; margin-top: 8px; }
:root[data-theme="dark"] .abs-count { background: #3d2e0a; color: #fcd34d; }
/* Nuevo evento: las vacaciones se piden aparte */
.vac-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; padding: 10px 12px; border-radius: 12px; background: #ecfdf3; color: #166534; font-size: .82rem; }
.vac-hint .btn { margin-left: auto; }
:root[data-theme="dark"] .vac-hint { background: #0f2e1d; color: #86efac; }

.tl-src { font-size: .7rem; color: #15803d; }
.member-role-ro { font-size: .74rem; font-weight: 600; color: var(--text); padding: 3px 0; }

/* Nuevo evento: sugerencias de participantes */
.att-sug { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); display: grid; gap: 2px; padding: 6px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 32px -12px rgba(16, 24, 40, .3); max-height: 280px; overflow: auto; }
.att-sug[hidden] { display: none; }
.att-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.att-item:hover, .att-item.on { background: var(--bg-alt); }
.att-item .av { flex: none; }
.att-txt { display: grid; flex: 1; min-width: 0; }
.att-txt b { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-txt small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-item em { flex: none; font-style: normal; font-size: .66rem; font-weight: 700; color: var(--muted); background: var(--bg-alt); border-radius: 999px; padding: 2px 8px; }
label:has(> .att-sug) { position: relative; }
/* «Ausentes hoy»: el contador no se estira */
.cal-side .cal-card .panel-head h3 { white-space: nowrap; }

/* Mis reuniones: acta en Word (aprobar y enviar) */
.acta-card { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid #ddd6fe; background: linear-gradient(135deg, #faf8ff, #fff5f9); }
.acta-card.sent { border-color: #bbf7d0; background: linear-gradient(135deg, #f0fdf4, #ffffff); }
.acta-card > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.acta-card small { color: var(--muted); font-size: .76rem; }
.acta-ico { font-size: 1.6rem; flex: none; }
.acta-dialog { width: min(620px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 30px 60px -20px rgba(16, 24, 40, .45); }
.acta-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.acta-send { display: grid; gap: 10px; padding: 22px 24px; max-height: 86vh; overflow: auto; }
.acta-send-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.acta-send-head h3 { margin: 0 0 2px; }
.acta-send h4 { margin: 6px 0 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.acta-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; max-height: 220px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.acta-people .check { display: flex; align-items: center; gap: 8px; font-size: .84rem; }
.acta-send label:not(.check) { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; }
.acta-send .row-btns { justify-content: flex-end; }
:root[data-theme="dark"] .acta-card { background: #1f1a35; border-color: #3b2f6b; }
:root[data-theme="dark"] .acta-card.sent { background: #0f2e1d; border-color: #14532d; }
@media (max-width: 560px) { .acta-people { grid-template-columns: 1fr; } .acta-card { flex-wrap: wrap; } }

/* Mi perfil → Outlook: actualizar permisos */
.ol-upgrade { display: grid; gap: 6px; justify-items: start; margin: 8px 0 12px; padding: 12px 14px; border-radius: 12px; background: #fff7e6; border: 1px solid #fde68a; color: #92400e; font-size: .84rem; }
.ol-line.ok { color: #15803d; }
:root[data-theme="dark"] .ol-upgrade { background: #3d2e0a; border-color: #854d0e; color: #fcd34d; }
.team-abs-btn { justify-content: center; }

/* Nuevo evento: ventana más amplia y participantes con chips */
#genDialog.ev-form { width: min(880px, calc(100vw - 32px)); max-width: 880px; }
.att-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 48px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); cursor: text; transition: border-color .15s, box-shadow .15s; }
.att-box:focus-within { border-color: #14b8a6; box-shadow: 0 0 0 3px rgba(20, 184, 166, .15); }
.att-chips { display: contents; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 4px; border-radius: 999px; background: var(--bg-alt);
  border: 1px solid var(--line); font-size: .82rem; font-weight: 600; white-space: nowrap; max-width: 100%; }
.att-chip .av { width: 22px; height: 22px; font-size: .55rem; flex: none; }
.att-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .72rem; width: 20px; height: 20px; border-radius: 50%; }
.att-chip button:hover { background: #fee2e2; color: #dc2626; }
.att-input { flex: 1; min-width: 200px; border: 0; outline: 0; background: none; font: inherit; font-size: .9rem; color: var(--text); padding: 6px 4px; }
.att-sug { padding: 8px; max-height: 340px; border-radius: 14px; }
.att-sug-head { padding: 4px 8px 6px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.att-item { padding: 9px 10px; gap: 12px; }
.att-item .av.sm { width: 34px; height: 34px; font-size: .72rem; }
.att-txt b { font-size: .9rem; }
.att-txt small { font-size: .76rem; }
.att-item em.t-equipo { background: #dcfce7; color: #15803d; }
.att-item em.t-outlook { background: #dbeafe; color: #1d4ed8; }
.att-item em.t-nuevo { background: #fef3c7; color: #b45309; }

/* Disponibilidad de compañeros (Asistente de programación) */
.av-form { margin: 2px 0 8px; }
.av-grid { --av-l: 190px; display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.av-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 12px; border-radius: 10px; font-size: .84rem; font-weight: 600; }
.av-sum.ok { background: #ecfdf3; color: #166534; } .av-sum.warn { background: #fff7e6; color: #92400e; }
.av-scale { display: grid; grid-template-columns: var(--av-l) 1fr; height: 16px; }
.av-scale > div { position: relative; }
.av-scale em { position: absolute; transform: translateX(-50%); font-style: normal; font-size: .64rem; color: var(--muted); }
.av-body { position: relative; display: grid; gap: 4px; }
.av-row { display: grid; grid-template-columns: var(--av-l) 1fr; align-items: center; min-height: 40px; border-radius: 8px; }
.av-row.clash .av-who small { color: #dc2626; font-weight: 600; }
.av-who { display: flex; align-items: center; gap: 8px; min-width: 0; padding-right: 10px; }
.av-who > span { display: grid; min-width: 0; }
.av-who b { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-who small { font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-track { position: relative; height: 30px; border-radius: 8px; background: repeating-linear-gradient(90deg, var(--bg-alt) 0 calc(100% / 13 - 1px), color-mix(in srgb, var(--line) 80%, transparent) calc(100% / 13 - 1px) calc(100% / 13)); }
.av-off { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(148, 163, 184, .18) 0 4px, transparent 4px 8px); }
.av-blk { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: #6a3cf0; overflow: hidden; min-width: 3px; }
.av-blk span { display: block; padding: 0 6px; font-size: .66rem; line-height: 24px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: normal; }
.av-blk.st-tentative { background: repeating-linear-gradient(135deg, #a78bfa 0 5px, #c4b5fd 5px 10px); }
.av-blk.st-oof { background: #db2777; }
.av-blk.st-workingElsewhere { background: #0ea5e9; }
.av-slot { position: absolute; top: -2px; bottom: -2px; border: 2px solid #14b8a6; border-radius: 8px; background: rgba(20, 184, 166, .12); z-index: 2; pointer-events: none; }
.av-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 0; font-size: .7rem; color: var(--muted); }
.av-legend span { display: inline-flex; align-items: center; gap: 5px; }
.av-legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.av-legend i.st-busy { background: #6a3cf0; } .av-legend i.st-tentative { background: #c4b5fd; } .av-legend i.st-oof { background: #db2777; }
.av-legend i.av-off-l { background: repeating-linear-gradient(135deg, rgba(148, 163, 184, .5) 0 3px, transparent 3px 6px); border: 1px solid var(--line); }
.av-legend i.av-slot-l { border: 2px solid #14b8a6; background: rgba(20, 184, 166, .12); }
.av-grid.big .av-track { height: 38px; } .av-grid.big .av-row { min-height: 48px; }
.av-grid.big .av-blk span { line-height: 32px; font-size: .7rem; }
.av-dialog { width: min(1040px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 30px 60px -20px rgba(16, 24, 40, .45); }
.av-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.av-pop { display: grid; gap: 12px; padding: 22px 24px; max-height: 88vh; overflow: auto; }
.av-pop-head { display: flex; justify-content: space-between; gap: 12px; } .av-pop-head h3 { margin: 0 0 2px; }
.av-pop-bar { display: flex; align-items: center; gap: 10px; } .av-pop-bar b { text-transform: capitalize; min-width: 230px; text-align: center; }
.av-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.av-chk { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; cursor: pointer; user-select: none; }
.av-chk input { display: none; } .av-chk.on { background: #ede9fe; border-color: #c4b5fd; font-weight: 600; }
:root[data-theme="dark"] .av-chk.on { background: #2e2550; border-color: #5b47a8; }
@media (max-width: 640px) { .av-grid { --av-l: 110px; } }

/* Disponibilidad: más ordenado (tamaño fijo, líneas por hora, «ahora», filas explicadas) */
.av-pop { min-height: min(640px, 86vh); align-content: start; }
#avBody { min-height: 380px; max-height: 58vh; overflow: auto; }
.av-pop-bar b { text-transform: none; }
.av-pick-head { display: flex; align-items: center; gap: 10px; font-size: .8rem; }
.av-chk { padding: 5px 12px 5px 6px; }
.av-tick-ico { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--bg-alt); font-size: .7rem; font-weight: 800; color: var(--muted); }
.av-chk.on .av-tick-ico { background: #6a3cf0; color: #fff; }
.av-track { background: var(--bg-alt); }
.av-track.na { background: repeating-linear-gradient(135deg, var(--bg-alt) 0 6px, transparent 6px 12px); opacity: .7; }
.av-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.av-now { position: absolute; top: -6px; bottom: -4px; width: 2px; margin-left: -1px; background: #ef4444; z-index: 3; border-radius: 2px; }
.av-now::before { content: "ahora"; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: .6rem; font-weight: 800; color: #ef4444; }
.av-grid.big .av-who small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.av-grid.big { --av-l: 260px; }
.av-blk { z-index: 1; box-shadow: 0 1px 2px rgba(16, 24, 40, .15); }
.av-now::before { top: auto; bottom: -15px; }
.av-grid.big .av-body { padding-bottom: 14px; }

/* Chat: Microsoft Teams dentro de KLOUSEN */
.teams-logo { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: #5b5fc7; color: #fff; font-size: .62rem; font-weight: 800; margin-right: 4px; vertical-align: -3px; }
.teams-logo.sm { width: 14px; height: 14px; font-size: .5rem; border-radius: 4px; margin-right: 2px; vertical-align: -2px; }
.teams-head b { display: inline-flex; align-items: center; }
.teams-connect { display: grid; gap: 6px; margin: 4px 6px 10px; padding: 12px; border-radius: 12px; background: linear-gradient(135deg, #eef0ff, #f7f5ff); border: 1px solid #d6d8f5; }
.teams-connect small { color: var(--muted); font-size: .74rem; }
.teams-connect .btn { justify-self: start; background: #5b5fc7; border-color: #5b5fc7; }
.teams-chan { display: flex !important; align-items: center; gap: 8px; text-align: left; }
.teams-chan .av { flex: none; width: 28px; height: 28px; font-size: .62rem; }
.teams-chan-txt { display: grid; min-width: 0; flex: 1; }
.teams-chan-txt b { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.teams-chan-txt small { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.teams-when { flex: none; font-size: .64rem; color: var(--muted); align-self: flex-start; margin-top: 2px; }
.teams-chan.active { background: #eef0ff; }
.teams-compose textarea:focus { border-color: #5b5fc7; box-shadow: 0 0 0 3px rgba(91, 95, 199, .15); }
.teams-compose .btn-primary { background: #5b5fc7; border-color: #5b5fc7; }
.teams-sys { text-align: center; font-size: .72rem; color: var(--muted); margin: 8px 0; }
.teams-tag { margin-left: 6px; font-size: .62rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #eef0ff; color: #4b4fb5; }
.teams-tag.ok { background: #ecfdf3; color: #15803d; }
.teams-link-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #eef0ff; color: #4b4fb5; }
:root[data-theme="dark"] .teams-connect, :root[data-theme="dark"] .teams-chan.active, :root[data-theme="dark"] .teams-tag, :root[data-theme="dark"] .teams-link-badge { background: #262a5e; border-color: #3b3f86; color: #c7c9ff; }

/* Avisos de confirmación de KLOUSEN (reemplazan los del navegador) */
.kx-dlg { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 70px -20px rgba(16, 24, 40, .5); }
.kx-dlg::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.kx-dlg[open] { animation: kxPop .18s cubic-bezier(.2, .8, .3, 1); }
@keyframes kxPop { from { transform: translateY(8px) scale(.97); opacity: 0; } }
.kx-dlg-box { display: grid; gap: 18px; padding: 24px 24px 20px; }
.kx-dlg-head { display: flex; gap: 14px; align-items: flex-start; }
.kx-dlg-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #eef2ff; font-size: 1.2rem; }
.kx-dlg-box.danger .kx-dlg-ico { background: #fee2e2; }
.kx-dlg-head h3 { margin: 2px 0 6px; font-size: 1.04rem; line-height: 1.35; }
.kx-dlg-head p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.kx-dlg-input { width: 100%; }
.kx-dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.kx-dlg .btn-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.kx-dlg .btn-danger:hover { background: #b91c1c; }
:root[data-theme="dark"] .kx-dlg-ico { background: #26285a; }
:root[data-theme="dark"] .kx-dlg-box.danger .kx-dlg-ico { background: #4a1d1d; }
@media (prefers-reduced-motion: reduce) { .kx-dlg[open] { animation: none; } }

/* Teams: buscador, adjuntos, archivos recibidos y chats con mensajes nuevos */
.teams-search { padding: 0 6px 8px; }
.teams-search .input { width: 100%; border-radius: 10px; }
.teams-chan.unread .teams-chan-txt b { font-weight: 800; color: var(--text); }
.teams-chan.unread .teams-chan-txt small { color: var(--text); font-weight: 600; }
.teams-chan.unread .teams-when::after { content: ""; display: block; width: 8px; height: 8px; margin: 4px 0 0 auto; border-radius: 50%; background: #5b5fc7; }
.teams-att { display: none; font-size: 1.05rem; cursor: pointer; flex: none; align-self: center; }
.teams-compose .teams-att { display: inline-grid; place-items: center; }
.teams-file { display: inline-flex; align-items: center; gap: 8px; margin: 4px 6px 0 0; padding: 8px 12px; border: 1px solid #d6d8f5; border-radius: 10px;
  background: #f7f7ff; color: var(--text); text-decoration: none; font-size: .82rem; max-width: 100%; }
.teams-file b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.teams-file small { color: #4b4fb5; font-size: .72rem; }
.teams-file:hover { border-color: #5b5fc7; }
.teams-up { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
:root[data-theme="dark"] .teams-file { background: #1f2248; border-color: #3b3f86; }

/* Teams: cabecera compacta, favoritos y grupos */
.teams-head { flex-wrap: nowrap; }
.teams-head b { white-space: nowrap; }
.teams-head-btns { display: inline-flex; gap: 2px; margin-left: auto; }
.teams-head-btns .icon-btn { width: 28px; height: 28px; font-size: .85rem; }
.teams-row { position: relative; }
.teams-row-acts { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; background: var(--surface); border-radius: 8px; padding: 2px; box-shadow: 0 2px 8px rgba(16, 24, 40, .12); }
.teams-row:hover .teams-row-acts, .teams-row:focus-within .teams-row-acts { display: inline-flex; }
.teams-row-acts .icon-btn { width: 26px; height: 26px; font-size: .8rem; }
.teams-row.is-fav .teams-chan-txt b::after { content: " ★"; color: #eab308; font-size: .72rem; }
.teams-sec { display: flex; align-items: center; gap: 6px; margin: 10px 6px 2px; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.teams-sec b { font-weight: 700; }
.teams-sec small { margin-left: auto; }
.teams-sec.grp { justify-content: space-between; }
.teams-sec-tog { display: inline-flex; align-items: center; gap: 6px; flex: 1; border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; padding: 2px 0; }
.teams-sec-tog::before { content: "▾"; font-size: .7rem; transition: transform .15s; }
.teams-sec.closed .teams-sec-tog::before { transform: rotate(-90deg); }
.teams-sec-tog small { margin-left: auto; }
.tg-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--gc, #5b5fc7); flex: none; display: inline-block; }
.tg-new { width: 8px; height: 8px; border-radius: 50%; background: #5b5fc7; margin-left: 4px; }
.tg-pick { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.tg-pick .check { display: flex; align-items: center; gap: 8px; font-size: .9rem; }

/* Chat: modo de la empresa (KLOUSEN + Teams · Solo Teams) */
.chat-mode-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 6px 10px; padding: 8px 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); font-size: .76rem; }
#view-chat.teams-only .kx-chat-only { display: none; }
#view-chat.teams-only #chanList { display: none; }
.cm-opts { display: grid; gap: 8px; }
.cm-opt { display: grid; gap: 4px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.cm-opt input { display: none; }
.cm-opt.on { border-color: #5b5fc7; background: #f5f5ff; }
.cm-opt small { color: var(--muted); font-size: .78rem; line-height: 1.4; }
:root[data-theme="dark"] .cm-opt.on { background: #1f2248; }

/* Teams: imágenes dentro del chat (clic = verla en grande) */
.teams-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.teams-imgs a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-alt); line-height: 0; }
.teams-imgs img { display: block; max-width: 320px; max-height: 240px; width: auto; height: auto; object-fit: cover; cursor: zoom-in; }
.teams-imgs a:hover { box-shadow: 0 6px 16px -8px rgba(16, 24, 40, .35); }

/* Teams: llamar, videollamada y agendar desde el chat */
.teams-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.teams-actions .btn-soft { background: #eef0ff; color: #4b4fb5; border-color: #d6d8f5; }
:root[data-theme="dark"] .teams-actions .btn-soft { background: #262a5e; color: #c7c9ff; border-color: #3b3f86; }

/* Mis reuniones: acta destacada arriba y botones en la lista */
.acta-top { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; padding: 16px 18px; border-radius: 16px;
  border: 1px solid #ddd6fe; background: linear-gradient(135deg, #f6f3ff, #fff5f9); }
.acta-top.sent { border-color: #bbf7d0; background: linear-gradient(135deg, #f0fdf4, #ffffff); }
.acta-top.pending { border-style: dashed; }
.acta-top > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.acta-top b { font-size: .98rem; }
.acta-top small { color: var(--muted); font-size: .8rem; }
.acta-top .acta-ico { font-size: 1.9rem; }
.meet-side { display: grid; justify-items: end; gap: 8px; align-content: center; }
.meet-acta-btns { display: inline-flex; gap: 6px; }
.tag.acta-ok { background: #dcfce7; color: #15803d; }
:root[data-theme="dark"] .acta-top { background: #1f1a35; border-color: #3b2f6b; }
:root[data-theme="dark"] .acta-top.sent { background: #0f2e1d; border-color: #14532d; }
@media (max-width: 640px) { .acta-top { flex-wrap: wrap; } .meet-side { justify-items: start; } }

/* Tareas → origen «Proyectos»: filtro por proyecto en lugar de área */
#projectFilter { display: none; }
body.project-view #projectFilter { display: inline-block; }
body.project-view #moduleFilter { display: none; }
body.project-view #projectFilter { max-width: 240px; }

/* Ticketera → Analítica */
.ta-dialog { --ta-s1: #2a78d6; --ta-s3: #1baf7a; --ta-crit: #e34948; --ta-surface: #fcfcfb;
  width: min(1180px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 20px; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 70px -20px rgba(16, 24, 40, .45); }
.ta-dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
:root[data-theme="dark"] .ta-dialog { --ta-s1: #3987e5; --ta-s3: #199e70; --ta-crit: #e66767; }
.ta-pop { position: relative; display: grid; gap: 16px; padding: 22px 24px 24px; max-height: 90vh; overflow: auto; }
.ta-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ta-head h3 { margin: 0 0 2px; font-size: 1.15rem; }
.ta-head-r { display: flex; align-items: center; gap: 8px; }
.ta-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ta-tile { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ta-tile small { font-size: .74rem; font-weight: 600; color: var(--muted); }
.ta-tile b { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ta-tile span { font-size: .72rem; color: var(--muted); }
.ta-tile.crit { border-color: color-mix(in srgb, var(--ta-crit) 45%, var(--line)); background: color-mix(in srgb, var(--ta-crit) 6%, var(--surface)); }
.ta-tile.crit b { color: var(--ta-crit); }
.ta-tile.warn { border-color: #fde68a; background: #fffbeb; }
.ta-tile.ok b { color: #16a34a; }
:root[data-theme="dark"] .ta-tile.warn { background: #3d2e0a; border-color: #854d0e; }
.ta-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ta-card { display: grid; gap: 10px; align-content: start; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); min-width: 0; }
.ta-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ta-card-head h4 { margin: 0; font-size: .95rem; }
.ta-legend { display: inline-flex; gap: 12px; font-size: .72rem; color: var(--muted); }
.ta-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ta-legend i, .ta-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ta-bars { display: grid; gap: 6px; }
.ta-bar-row { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; align-items: center; gap: 10px; padding: 3px 4px; border-radius: 8px; cursor: pointer; }
.ta-bar-row:hover { background: var(--bg-alt); }
.ta-bar-label { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.ta-bar-track { display: flex; align-items: center; gap: 2px; min-width: 0; height: 22px; }
.ta-seg { display: block; height: 16px; min-width: 3px; }
.ta-seg:first-child { border-radius: 4px 0 0 4px; }
.ta-seg:last-of-type { border-radius: 0 4px 4px 0; }
.ta-seg:only-of-type { border-radius: 4px; }
.ta-bar-val { margin-left: 8px; font-size: .78rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ta-bar-val small { font-weight: 500; color: var(--muted); }
.ta-foot { margin: 2px 0 0; font-size: .72rem; color: var(--muted); }
.ta-trend { position: relative; }
.ta-trend svg { width: 100%; height: 220px; display: block; }
.ta-grid { stroke: color-mix(in srgb, var(--text) 10%, transparent); stroke-width: 1; }
.ta-ax { font-size: 10px; fill: var(--muted); }
.ta-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ta-dot { stroke: var(--surface); stroke-width: 2; }
.ta-cross { stroke: color-mix(in srgb, var(--text) 35%, transparent); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.ta-tip, .ta-tooltip { position: absolute; z-index: 5; display: grid; gap: 3px; padding: 8px 10px; border-radius: 10px; background: #111827; color: #e5e7eb; font-size: .74rem; pointer-events: none; box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .45); }
.ta-tip { top: 0; min-width: 150px; }
.ta-tip span { display: flex; align-items: center; gap: 6px; }
.ta-tip b { color: #fff; }
.ta-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.ta-table th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ta-table td { padding: 8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.ta-table tr[data-open-ticket] { cursor: pointer; }
.ta-table tr[data-open-ticket]:hover td { background: var(--bg-alt); }
.ta-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ta-table td.late { color: var(--ta-crit); font-weight: 700; }
@media (max-width: 960px) { .ta-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ta-grid2 { grid-template-columns: 1fr; } }
.ta-card .ta-bars { max-height: 340px; overflow-y: auto; padding-right: 4px; }
.ta-card-head h4 small { font-weight: 500; }

/* Ticket abierto desde la analítica: volver y recorrer */
.ta-back { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; background: color-mix(in srgb, #2a78d6 8%, var(--surface)); border-bottom: 1px solid var(--line); border-radius: 16px 16px 0 0; }
.ta-back-nav { display: inline-flex; align-items: center; gap: 8px; }
.ta-back-nav small { color: var(--muted); font-size: .76rem; }

/* Proyectos → Resumen ejecutivo */
.ex-dash { --ex-s1: #2a78d6; --ex-good: #16a34a; --ex-warn: #d97706; --ex-crit: #dc2626; --ex-muted: #a1a1aa; display: grid; gap: 16px; }
:root[data-theme="dark"] .ex-dash { --ex-s1: #3987e5; --ex-good: #22c55e; --ex-warn: #f59e0b; --ex-crit: #ef4444; }
.ex-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ex-kpi { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); min-width: 0; }
.ex-kpi > div { display: grid; gap: 4px; min-width: 0; }
.ex-kpi small { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ex-kpi b { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ex-kpi b i { font-style: normal; font-size: 1rem; color: var(--muted); font-weight: 500; }
.ex-kpi span { font-size: .74rem; color: var(--muted); }
.ex-kpi span b { font-size: .74rem; letter-spacing: 0; }
.ex-kpi.warn { border-color: #fde68a; } .ex-kpi.crit { border-color: color-mix(in srgb, var(--ex-crit) 40%, var(--line)); }
.ex-kpi.crit > div > b { color: var(--ex-crit); } .ex-kpi.ok > div > b { color: var(--ex-good); }
.pos { color: var(--ex-good, #16a34a); } .neg { color: var(--ex-crit, #dc2626); }
.ex-ring { flex: none; } .ex-ring .bg { fill: none; stroke: var(--bg-alt); stroke-width: 7; }
.ex-ring .fg { fill: none; stroke-width: 7; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ex-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.ex-card { display: grid; gap: 12px; align-content: start; }
.ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ex-head h3 { margin: 0 0 2px; font-size: 1rem; } .ex-head small { color: var(--muted); font-size: .76rem; }
.ex-legend, .ex-stack-leg { display: flex; flex-wrap: wrap; gap: 12px; font-size: .72rem; color: var(--muted); }
.ex-legend span, .ex-stack-leg span { display: inline-flex; align-items: center; gap: 5px; }
.ex-legend .exd, .ex-stack-leg i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ex-stack-leg i { border-radius: 3px; } .ex-stack-leg b { color: var(--text); }
.exd.explan { background: var(--surface); border: 2px solid var(--muted); box-sizing: border-box; }
.ex-db-scale { display: grid; grid-template-columns: minmax(150px, 34%) 1fr 70px; gap: 12px; height: 14px; }
.ex-db-scale .sc { position: relative; } .ex-db-scale em { position: absolute; transform: translateX(-50%); font-style: normal; font-size: .64rem; color: var(--muted); }
.ex-db { display: grid; gap: 2px; max-height: 420px; overflow: auto; }
.ex-db-row { display: grid; grid-template-columns: minmax(150px, 34%) 1fr 70px; gap: 12px; align-items: center; padding: 6px 4px; border-radius: 10px; cursor: pointer; }
.ex-db-row:hover { background: var(--bg-alt); }
.ex-db-name { display: grid; min-width: 0; } .ex-db-name b { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-db-name small { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-db-track { position: relative; height: 22px; background: linear-gradient(var(--line), var(--line)) center / 100% 2px no-repeat; }
.ex-db-track .tick { position: absolute; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.ex-db-track .exseg { position: absolute; top: 9px; height: 4px; border-radius: 2px; opacity: .55; }
.ex-db-track .exd { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.ex-db-val { text-align: right; font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.ex-db-val small { display: block; font-size: .68rem; font-weight: 600; color: var(--ex-good); } .ex-db-val small.neg { color: var(--ex-crit); }
.ex-stack { display: flex; gap: 2px; height: 18px; border-radius: 6px; overflow: hidden; background: var(--bg-alt); }
.ex-stack i { display: block; height: 100%; }
.ex-sub { margin: 6px 0 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ex-att { max-height: 260px; overflow: auto; }
.ex-cols { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 190px; padding-top: 18px; }
.ex-col { position: relative; display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; cursor: default; }
.ex-col i { align-self: end; justify-self: center; width: 70%; max-width: 34px; background: var(--ex-s1); border-radius: 4px 4px 0 0; min-height: 0; }
.ex-col:hover i { filter: brightness(1.1); }
.ex-col-v { font-size: .6rem; color: var(--muted); white-space: nowrap; align-self: end; }
.ex-col small { font-size: .66rem; color: var(--muted); padding-top: 4px; border-top: 1px solid var(--line); text-transform: capitalize; }
.ex-due { display: grid; gap: 4px; }
.ex-due-row { display: flex; align-items: center; gap: 12px; padding: 7px 6px; border-radius: 10px; cursor: pointer; }
.ex-due-row:hover { background: var(--bg-alt); }
.ex-due-date { flex: none; display: grid; place-items: center; width: 44px; padding: 4px 0; border-radius: 10px; background: var(--bg-alt); line-height: 1.1; }
.ex-due-date b { font-size: 1.05rem; } .ex-due-date small { font-size: .62rem; text-transform: uppercase; color: var(--muted); }
.ex-due-date.soon { background: #fff4d6; } .ex-due-date.soon small { color: #b45309; }
.ex-due-txt { display: grid; flex: 1; min-width: 0; } .ex-due-txt b { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-due-txt small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-due-in { flex: none; font-size: .72rem; font-weight: 600; color: var(--muted); } .ex-due-in.soon { color: #b45309; }
:root[data-theme="dark"] .ex-due-date.soon { background: #3d2e0a; }
@media (max-width: 1200px) { .ex-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ex-grid { grid-template-columns: 1fr; } }
.ex-legend .exd { position: static; margin: 0; box-shadow: none; }

/* Proyectos → Cartera: Roadmap (línea de tiempo de la cartera) */
#projView { --ex-s1: #2a78d6; --ex-good: #16a34a; --ex-warn: #d97706; --ex-crit: #dc2626; --ex-muted: #a1a1aa; }
:root[data-theme="dark"] #projView { --ex-good: #22c55e; --ex-warn: #f59e0b; --ex-crit: #ef4444; }
.rm-tools { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rm-group { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.rm { --rm-l: 250px; --rm-r: 120px; padding: 16px 18px; }
.rm-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .72rem; color: var(--muted); margin-bottom: 10px; }
.rm-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rm-legend i { width: 14px; height: 8px; border-radius: 3px; display: inline-block; }
.rm-legend i.tent { background: repeating-linear-gradient(135deg, #94a3b8 0 3px, transparent 3px 6px); border: 1px solid #94a3b8; }
.rm-legend i.ms { width: 8px; height: 8px; border-radius: 1px; transform: rotate(45deg); background: var(--text); }
.rm-legend i.nowl { width: 2px; height: 12px; background: #ef4444; border-radius: 0; }
.rm-grid { position: relative; }
.rm-head, .rm-row, .rm-bg { display: grid; grid-template-columns: var(--rm-l) 1fr var(--rm-r); gap: 12px; align-items: center; }
.rm-head { position: sticky; top: 0; z-index: 3; background: var(--surface); height: 40px; border-bottom: 1px solid var(--line); }
.rm-scale { position: relative; height: 100%; }
.rm-scale em { position: absolute; bottom: 4px; font-style: normal; font-size: .64rem; color: var(--muted); padding-left: 4px; text-transform: capitalize; }
.rm-scale em.q { top: 2px; bottom: auto; font-weight: 700; color: var(--text); font-size: .66rem; }
.rm-body { position: relative; }
.rm-bg { position: absolute; inset: 0; pointer-events: none; }
.rm-bg .rm-lane { position: relative; height: 100%; }
.rm-bg .rm-lane > i { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--text) 6%, transparent); }
.rm-bg .rm-lane > i.q { background: color-mix(in srgb, var(--text) 14%, transparent); }
.rm-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #ef4444; z-index: 2; }
.rm-now span { position: absolute; top: -2px; left: 50%; transform: translate(-50%, -100%); font-size: .6rem; font-weight: 800; color: #fff; background: #ef4444; padding: 1px 6px; border-radius: 999px; }
.rm-group-h { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 8px; margin: 12px 0 2px; padding-top: 6px; border-top: 1px dashed var(--line); }
.rm-group-h b { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.rm-group-h small { font-size: .7rem; color: var(--muted); }
.rm-row { position: relative; z-index: 1; min-height: 44px; border-radius: 10px; cursor: pointer; }
.rm-row:hover { background: color-mix(in srgb, var(--bg-alt) 70%, transparent); }
.rm-name { display: grid; min-width: 0; padding-left: 4px; }
.rm-name b { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-name small { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-row .rm-lane { position: relative; height: 30px; }
.rm-bar { position: absolute; top: 5px; height: 20px; border-radius: 6px; background: color-mix(in srgb, var(--c) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); overflow: hidden; }
.rm-bar.tentative { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 25%, transparent) 0 4px, transparent 4px 8px); border-style: dashed; }
.rm-fill { position: absolute; inset: 0 auto 0 0; background: var(--c); border-radius: 5px 0 0 5px; }
.rm-bar span { position: relative; z-index: 1; display: block; padding: 0 6px; font-size: .64rem; font-weight: 700; line-height: 18px; color: var(--text); text-shadow: 0 0 3px var(--surface); white-space: nowrap; }
.rm-ms { position: absolute; top: 9px; width: 9px; height: 9px; margin-left: -4.5px; transform: rotate(45deg); background: var(--text); border: 2px solid var(--surface); z-index: 2; }
.rm-ms.done { background: var(--ex-good); } .rm-ms.late { background: var(--ex-crit); }
.rm-amt { display: grid; text-align: right; font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; padding-right: 4px; }
.rm-amt small { font-size: .68rem; font-weight: 600; color: var(--muted); }
.rm-undated { margin: 12px 0 0; font-size: .76rem; color: var(--muted); }
@media (max-width: 900px) { .rm { --rm-l: 140px; --rm-r: 80px; } }

/* Ficha del proyecto: encabezado ejecutivo y pestañas */
.pv-tabbed { --ex-s1: #2a78d6; --ex-good: #16a34a; --ex-warn: #d97706; --ex-crit: #dc2626; --ex-muted: #a1a1aa; }
.pv-hero { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 12px; }
.pvh-card { display: grid; gap: 3px; align-content: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; }
.pvh-card.main { grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
.pvh-card.main > div { display: grid; gap: 2px; }
.pvh-card small { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pvh-card b { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pvh-card span { font-size: .74rem; color: var(--muted); } .pvh-card span b { font-size: .74rem; }
.pvh-bar { display: block; height: 5px; border-radius: 3px; background: var(--bg-alt); overflow: hidden; margin-top: 4px; }
.pvh-bar i { display: block; height: 100%; border-radius: 3px; }
.pv-tabs { position: sticky; top: -1px; z-index: 5; display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 14px; padding: 4px; border-radius: 12px; background: var(--bg-alt); border: 1px solid var(--line); }
.pv-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: .84rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.pv-tabs button:hover { color: var(--text); }
.pv-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.pv-tabs button span { min-width: 18px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); font-size: .68rem; text-align: center; }
.pv-tabbed [data-pane] { display: none; }
.pv-tabbed[data-pvtab="resumen"] [data-pane="resumen"], .pv-tabbed[data-pvtab="gantt"] [data-pane="gantt"],
.pv-tabbed[data-pvtab="presupuesto"] [data-pane="presupuesto"], .pv-tabbed[data-pvtab="equipo"] [data-pane="equipo"],
.pv-tabbed[data-pvtab="docs"] [data-pane="docs"], .pv-tabbed[data-pvtab="actividad"] [data-pane="actividad"] { display: block; }
.pv-tabbed[data-pvtab="resumen"] .pv-grid[data-pane="resumen"] { display: grid; }
@media (max-width: 760px) { .pv-hero { grid-template-columns: 1fr 1fr; } }

/* Proyecto → observadores */
.pw-box { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
.pw-box .pd-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pw-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pw-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .82rem; font-weight: 600; }
.pw-chip .av { width: 22px; height: 22px; font-size: .55rem; }
.pw-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); width: 20px; height: 20px; border-radius: 50%; font-size: .7rem; }
.pw-chip button:hover { background: #fee2e2; color: #dc2626; }

/* El aviso (toast) va en la capa superior: sobre cualquier ventana emergente */
.toast[popover] { inset: auto; top: auto; right: auto; left: 50%; bottom: 24px; margin: 0; border: 0; overflow: visible;
  width: max-content; max-width: min(640px, calc(100vw - 32px)); height: auto; text-align: center; }

/* App instalable (PWA): botón «Instalar app» y ajustes cuando se abre como app */
.install-app { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #ddd6fe;
  background: linear-gradient(135deg, #f5f3ff, #fff5f9); color: #4c1d95; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; margin-right: 8px; }
.install-app:hover { border-color: #a78bfa; }
.install-app[hidden] { display: none; }
.ios-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: .92rem; }
.ios-share { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #e0e7ff; color: #2563eb; font-size: .8rem; }
:root[data-theme="dark"] .install-app { background: #1f1a35; border-color: #3b2f6b; color: #c4b5fd; }
/* Abierta como app: respeta la «muesca» y la barra de inicio del teléfono */
html.is-app body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
@media (max-width: 560px) { .install-app b { display: none; } .install-app { padding: 0 10px; } }

/* ===== Teléfono (≤ 860 px): ajustes para usar KLOUSEN como app ===== */
@media (max-width: 860px) {
  body.app, body.app.sb-collapsed { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar h1 { font-size: 1.25rem; }
  .topbar .tools { width: 100%; justify-content: space-between; }
  .dk-row, .ex-kpis, .ta-tiles, .pv-hero { grid-template-columns: 1fr 1fr; }
  .dk-grid, .ex-grid, .ta-grid2, .dash-grid { grid-template-columns: 1fr; }
  .dk-value { font-size: 1.5rem; }
  dialog { max-width: calc(100vw - 16px); }
  .cal-layout { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .ex-kpis, .pv-hero { grid-template-columns: 1fr; }
  .dk-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dk-card { padding: 12px; gap: 4px; }
  .dk-card small { display: none; }
  .dk-ico { width: 30px; height: 30px; }
  .dk-value { font-size: 1.3rem; }
  .topbar .tools { justify-content: flex-end; gap: 8px; }
  .main { padding: 0 12px 32px; }
}

/* Mi perfil → KLOUSEN en tu teléfono (QR) */
.app-qr { display: flex; gap: 16px; align-items: center; }
.app-qr img { flex: none; width: 168px; height: 168px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.app-qr ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .84rem; }
.app-qr-panel .link-btn { margin-top: 8px; }
@media (max-width: 1100px) { .app-qr { flex-direction: column; align-items: flex-start; } }

/* Mi perfil → KLOUSEN en tu teléfono (diseño ordenado) */
.aq { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.aq-code { display: grid; gap: 6px; justify-items: center; }
.aq-code img { width: 150px; height: 150px; padding: 8px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 20px -12px rgba(16, 24, 40, .3); }
.aq-code small { font-size: .7rem; color: var(--muted); }
.aq-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.aq-steps li { display: grid; grid-template-columns: 24px 30px 1fr; gap: 8px; align-items: start; }
.aq-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(130deg, #6a3cf0, #ff2d78); color: #fff; font-size: .74rem; font-weight: 800; }
.aq-ic { font-size: 1.15rem; line-height: 24px; text-align: center; }
.aq-steps b { display: block; font-size: .88rem; }
.aq-steps small { display: block; font-size: .76rem; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.aq-os { display: inline-flex; gap: 2px; margin: 6px 0 2px; padding: 2px; border-radius: 8px; background: var(--bg-alt); border: 1px solid var(--line); }
.aq-os button { border: 0; background: none; padding: 3px 10px; border-radius: 6px; font: inherit; font-size: .72rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.aq-os button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.aq-tip[hidden] { display: none; }
.aq-warn { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: #fff7e6; color: #92400e; font-size: .76rem; }
.aq-pc { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .8rem; color: var(--muted); }
:root[data-theme="dark"] .aq-warn { background: #3d2e0a; color: #fcd34d; }
@media (max-width: 1100px) { .aq { grid-template-columns: 1fr; justify-items: start; } }
.aq-tip b { display: inline; font-size: inherit; }
/* La tarjeta del QR se adapta a SU ancho (en Mi perfil va en una columna angosta) */
.app-qr-panel { container-type: inline-size; overflow: hidden; }
.aq-steps, .aq-steps li > div { min-width: 0; }
.aq-steps small, .aq-steps b { overflow-wrap: anywhere; }
@container (max-width: 560px) {
  .aq { grid-template-columns: 1fr; justify-items: center; gap: 16px; }
  .aq-steps { width: 100%; }
  .aq-pc { flex-direction: column; align-items: stretch; text-align: center; }
  .aq-pc .btn { width: 100%; justify-content: center; }
}

/* App instalada: botón «Actualizar» (como F5), discreto junto a la campana */
.app-reload { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent;
  color: var(--muted, #6b7280); cursor: pointer; opacity: .7; transition: opacity .15s, background .15s, color .15s; }
.app-reload:hover { opacity: 1; background: rgba(106, 60, 240, .08); color: #6a3cf0; }
.app-reload.spin svg { animation: appReloadSpin .7s linear infinite; }
@keyframes appReloadSpin { to { transform: rotate(360deg); } }

/* App instalada: encabezado separado del contenido (menos «todo blanco») */
html.is-app .topbar { background: linear-gradient(180deg, #f7f4ff, #f1ecff); border-bottom: 1px solid #e4dcfb;
  box-shadow: 0 6px 18px -14px rgba(46, 26, 110, .45); backdrop-filter: none; }
html.is-app .sidebar { background: #fbfaff; border-right: 1px solid #ece6fb; }
html.is-app[data-theme="dark"] .topbar { background: linear-gradient(180deg, #1b1536, #17122d); border-bottom-color: #2c2452; }
html.is-app[data-theme="dark"] .sidebar { background: #141026; border-right-color: #2c2452; }

/* ===== Vista de tarea: ficha a la izquierda + chat de la tarea con línea de tiempo a la derecha ===== */
dialog.tv2-wide { width: min(1240px, 100% - 32px); max-height: calc(100vh - 40px); padding: 0; overflow: hidden; }
.tv2 { display: grid; grid-template-columns: minmax(340px, 44%) 1fr; height: min(820px, calc(100vh - 40px)); }
.tv2-side { overflow-y: auto; padding: 22px 22px 0; background: #f4f6fb; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.tv2-head { display: flex; align-items: flex-start; gap: 6px; }
.tv2-head h3 { flex: 1; margin: 0; font-size: 1.25rem; line-height: 1.3; }
.tv2-sub { color: var(--muted); }
.tv2-box { background: var(--card, #fff); border-radius: 14px; padding: 12px 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); border: 1px solid var(--border); }
.tv2-box h4 { margin: 0 0 8px; font-size: .9rem; }
.tv2-box hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.tv2-row { display: grid; grid-template-columns: 128px 1fr; gap: 10px; padding: 7px 0; align-items: start; font-size: .9rem; }
.tv2-l { color: var(--muted); padding-top: 3px; }
.tv2-v { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.tv2-who { display: inline-flex; align-items: center; gap: 8px; }
.tv2-due.overdue { color: #dc2626; font-weight: 600; }
.tv2-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .76rem; border: 1px solid var(--border); color: var(--muted); }
.tv2-pill.late { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.tv2-pill.warn { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.tv2-pill.ok { color: #15803d; border-color: #86efac; background: #f0fdf4; }
.tv2-st { font-weight: 600; } .tv2-st.st-done { color: #15803d; } .tv2-st.st-doing { color: #2563eb; }
.tv2-id { font-size: .8rem; color: var(--muted); }
.tv2-proj { border: 0; background: none; padding: 0; font: inherit; color: var(--text); cursor: pointer; font-weight: 600; text-align: left; }
.tv2-proj:hover { color: #6a3cf0; text-decoration: underline; }
.tv2-stage { display: inline-block; padding: 3px 16px 3px 10px; background: #dff6fb; color: #0e9fbf; font-weight: 600; font-size: .8rem;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); border-radius: 4px 0 0 4px; }
.tv2-watch { display: inline-flex; align-items: center; gap: 4px; }
.tv2-watch-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tv2-foot { position: sticky; bottom: 0; margin: auto -22px 0; padding: 12px 22px; background: #f4f6fb; border-top: 1px solid var(--border);
  display: flex; gap: 14px; align-items: center; }
.tv2-foot .btn { margin-left: auto; }
.tv2-chat { display: flex; flex-direction: column; min-height: 0; background: linear-gradient(160deg, #eef2ff, #e0f2fe 55%, #ede9fe); }
.tv2-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--card, #fff); border-bottom: 1px solid var(--border); }
.tv2-chat-head > div { flex: 1; display: flex; flex-direction: column; }
.tv2-chat-head small { color: var(--muted); }
.tv2-chat-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #eef2ff; font-size: 1.1rem; }
.tv2-scroll { flex: 1; overflow-y: auto; padding: 16px 22px 0; }
.tv2-timeline { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.tv2-day { text-align: center; }
.tv2-day span { display: inline-block; padding: 4px 14px; border-radius: 999px; background: rgba(100, 116, 139, .55); color: #fff; font-size: .78rem; }
.tv2-ev { position: relative; align-self: center; width: min(560px, 100%); box-sizing: border-box; background: rgba(255, 255, 255, .9); border-radius: 14px; padding: 10px 14px 20px; font-size: .88rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.tv2-ev p { margin: 0; }
.tv2-ev time { position: absolute; right: 12px; bottom: 4px; font-size: .7rem; color: var(--muted); }
.tv2-ev.late { border-left: 3px solid #ef4444; }
.tv2-ev.warn { border-left: 3px solid #f59e0b; }
.tv2-ev.ok { border-left: 3px solid #22c55e; }
.tv2-card { margin-top: 8px; padding: 4px 0 0 12px; border-left: 3px solid #6a3cf0; }
.tv2-card > b { color: #4f46e5; }
.tv2-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 8px 0 0; }
.tv2-card dt { font-weight: 600; }
.tv2-card dd { margin: 0; }
.tv2-scroll .thread { background: var(--card, #fff); border-radius: 14px 14px 0 0; padding: 12px 14px 0; margin: 0; }
.tv2-scroll .note-compose, .tv2-scroll .thread-compose { position: sticky; bottom: 0; background: var(--card, #fff); padding-bottom: 12px; }
:root[data-theme="dark"] .tv2-side, :root[data-theme="dark"] .tv2-foot { background: #131022; }
:root[data-theme="dark"] .tv2-chat { background: linear-gradient(160deg, #18143a, #0f1d2e 55%, #1c1636); }
:root[data-theme="dark"] .tv2-ev { background: rgba(30, 27, 55, .92); }
@media (max-width: 860px) {
  .tv2 { grid-template-columns: 1fr; height: auto; max-height: calc(100vh - 20px); overflow-y: auto; }
  .tv2-side { overflow: visible; border-right: 0; }
  .tv2-scroll { overflow: visible; }
}

/* ✕ automática para cerrar cualquier ventana emergente (dialog-x.js) */
dialog > .kx-x { position: absolute; top: 12px; right: 12px; z-index: 5; width: 32px; height: 32px; border-radius: 50%; border: 0;
  display: grid; place-items: center; font-size: 15px; line-height: 1; cursor: pointer; color: var(--muted, #6b7280);
  background: color-mix(in srgb, var(--card, #fff) 85%, transparent); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); transition: background .15s, color .15s; }
dialog > .kx-x:hover { background: #fee2e2; color: #dc2626; }
dialog > .kx-x:focus-visible { outline: 2px solid #6a3cf0; outline-offset: 2px; }

/* Vista de «Tareas» (ex Mejora continua) en el formato de dos columnas */
.tv2.imp-pro .tv2-head { align-items: center; }
.tv2.imp-pro .imp-code { flex: none; }
.tv2.imp-pro .deal-steps { margin: 2px 0; }
.tv2.imp-pro .tv2-kpis { margin: 0; background: var(--card, #fff); }
.tv2.imp-pro .tv2-kpis > div { flex: 1 1 31%; border-bottom: 1px solid var(--border); }
.tv2-box .pd-sec { margin: 0 0 10px; } .tv2-box .pd-sec:last-child { margin-bottom: 0; }
.tv2-foot .btn-ghost { margin-left: auto; } .tv2-foot .btn-ghost + .btn { margin-left: 0; }
.tv2-side > * { flex-shrink: 0; }
.tv2 .deal-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 4px 0 2px; }
.tv2 .deal-steps .ds-step span { font-size: .72rem; text-align: center; }
.tv2 .imp-kpis > div > :not(b):not(small) { white-space: nowrap; justify-self: start; }

/* Subtareas: etiqueta «↳ origen» integrada antes del título (colores de «Tus pendientes por origen») */
.sub-of { --so: #7c3aed; display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; padding: 2px 8px 2px 6px; vertical-align: 1px;
  border-radius: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; line-height: 1.5; white-space: nowrap;
  color: var(--so); background: color-mix(in srgb, var(--so) 10%, transparent); border: 1px solid color-mix(in srgb, var(--so) 28%, transparent);
  box-shadow: inset 3px 0 0 var(--so); }
.sub-of i { font-style: normal; font-weight: 800; opacity: .75; }
.sub-of.imp { --so: #ea580c; }
.sub-of.proj { --so: #16a34a; }
.t-title .t-name { font-weight: 600; }
.t-title.done .t-name { font-weight: 500; }
.tcard-sub { margin: 6px 0 -4px; }
.tcard-sub .sub-of { font-size: .68rem; }
.tv2-head h3 .tv2-parent { display: block; margin-bottom: 6px; }
.tv2-head h3 .sub-of { font-size: .74rem; }
:root[data-theme="dark"] .sub-of.imp { --so: #fb923c; }
:root[data-theme="dark"] .sub-of.proj { --so: #4ade80; }
/* Tareas madre (sección Tareas): código con la misma etiqueta naranja; sin «↳» porque son el origen */
.sub-of.parent { margin-right: 0; padding: 3px 9px; font-size: .74rem; box-shadow: inset 3px 0 0 var(--so); }
.imp-subs { display: block; margin-top: 3px; font-size: .74rem; color: var(--muted); font-weight: 500; }
.imp-subs .late { color: #dc2626; }

/* Menú lateral: guía sutil de «qué va con qué» (nav-guide.js) */
.nav-guide { position: fixed; z-index: 60; width: 270px; padding: 12px 14px; border-radius: 12px; pointer-events: none;
  background: var(--card, #fff); border: 1px solid var(--border); box-shadow: 0 12px 32px -12px rgba(15, 23, 42, .28);
  opacity: 0; transform: translateX(-4px); transition: opacity .16s ease, transform .16s ease; }
.nav-guide.on { opacity: 1; transform: none; }
.nav-guide::before { content: ""; position: absolute; left: -6px; top: calc(var(--ay, 50%) - 6px); width: 10px; height: 10px; background: inherit;
  border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: rotate(45deg); }
.nav-guide b { display: block; font-size: .86rem; margin-bottom: 3px; }
.nav-guide p { margin: 0; font-size: .8rem; line-height: 1.45; color: var(--muted); }
.nav-guide .ng-rel { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border); }
.nav-guide .ng-rel small { width: 100%; font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-guide .ng-rel span { padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 600; color: #6a3cf0; background: rgba(106, 60, 240, .08); }
#sidebar .side-btn.nav-rel { background: rgba(106, 60, 240, .06); box-shadow: inset 2px 0 0 rgba(106, 60, 240, .55); transition: background .2s, box-shadow .2s; }
#sidebar .side-btn.nav-rel .sb-ic { color: #6a3cf0; }
:root[data-theme="dark"] .nav-guide .ng-rel span { color: #c4b5fd; background: rgba(167, 139, 250, .14); }
:root[data-theme="dark"] #sidebar .side-btn.nav-rel { background: rgba(167, 139, 250, .1); }
.me-item .me-state { float: right; margin-left: 12px; font-size: .74rem; font-weight: 600; color: var(--muted); }

/* ===== Chat de la tarea en vivo (task-chat.js): panel de estadísticas + cronograma, notas fijadas, burbujas y redacción ===== */
.tv2-chat .tc-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tc-top { padding: 12px 20px 10px; background: var(--card, #fff); border-bottom: 1px solid var(--border); }
.tc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.tc-kpi { padding: 7px 10px; border-radius: 10px; background: var(--bg-alt, #f4f6fb); display: grid; gap: 1px; }
.tc-kpi small { font-size: .62rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tc-kpi b { font-size: .92rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-kpi.bad { background: #fef2f2; } .tc-kpi.bad b { color: #dc2626; }
.tc-kpi.warn { background: #fffbeb; } .tc-kpi.warn b { color: #b45309; }
.tc-kpi.good { background: #f0fdf4; } .tc-kpi.good b { color: #15803d; }
.tc-kpi.info b { color: #4f46e5; }
.tc-gantt { margin-top: 10px; }
.tc-gbar { position: relative; height: 8px; border-radius: 999px; background: #e9e5fb; }
.tc-gbar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, #6a3cf0, #a78bfa); transition: width .4s; }
.tc-gantt.late .tc-gbar { background: #fde2e2; }
.tc-gantt.late .tc-gbar > i { background: linear-gradient(90deg, #f97316, #ef4444); }
.tc-tick { position: absolute; top: -3px; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: #94a3b8; box-shadow: 0 0 0 2px var(--card, #fff); }
.tc-tick.ok { background: #22c55e; } .tc-tick.late { background: #ef4444; }
.tc-now { position: absolute; top: -5px; width: 2px; height: 18px; margin-left: -1px; background: #0f172a; border-radius: 1px; }
.tc-now::after { content: "Hoy"; position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font-size: .6rem; font-weight: 700; color: #0f172a; }
.tc-glbl { display: flex; justify-content: space-between; margin-top: 4px; font-size: .7rem; color: var(--muted); }
.tc-glbl .late { color: #dc2626; font-weight: 600; }
.tc-pins { padding: 8px 20px 10px; background: #fffbeb; border-bottom: 1px solid #fde68a; }
.tc-pins-head { display: flex; align-items: center; gap: 6px; font-size: .8rem; margin-bottom: 6px; }
.tc-pins-head small { margin-left: auto; padding: 0 7px; border-radius: 999px; background: #fde68a; color: #92400e; font-weight: 700; }
.tc-pins-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.tc-pin { flex: 0 0 min(240px, 80%); text-align: left; border: 1px solid #fde68a; background: #fff; border-radius: 10px; padding: 6px 10px; cursor: pointer; display: grid; gap: 1px; font: inherit; }
.tc-pin:hover { border-color: #f59e0b; }
.tc-pin b { font-size: .72rem; } .tc-pin small { font-size: .66rem; color: var(--muted); }
.tc-pin span { font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 20px; }
.tc-feed { display: flex; flex-direction: column; gap: 10px; }
.tc-empty { text-align: center; margin: 30px 0; }
.tc-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 82%; }
.tc-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.tc-av .av { width: 28px; height: 28px; font-size: .68rem; }
.tc-bub { position: relative; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--card, #fff); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); min-width: 120px; }
.tc-msg.me .tc-bub { border-radius: 14px 14px 4px 14px; background: #ede9fe; }
.tc-msg.pinned .tc-bub { background: #fffbeb; box-shadow: inset 3px 0 0 #f59e0b, 0 1px 2px rgba(15, 23, 42, .08); }
.tc-msg.flash .tc-bub { animation: tcFlash 1.4s ease; }
@keyframes tcFlash { 0%, 40% { box-shadow: 0 0 0 3px #f59e0b; } }
.tc-meta { display: flex; align-items: center; gap: 6px; font-size: .72rem; margin-bottom: 2px; }
.tc-meta time { margin-left: auto; color: var(--muted); font-size: .66rem; }
.tc-chan { padding: 0 6px; border-radius: 4px; background: rgba(234, 88, 12, .1); color: #c2410c; font-size: .64rem; font-weight: 700; }
.tc-pin-tag { color: #b45309; font-weight: 700; font-size: .66rem; }
.tc-text { font-size: .88rem; line-height: 1.45; word-wrap: break-word; }
.tc-acts { position: absolute; top: -12px; right: 6px; display: none; gap: 2px; background: var(--card, #fff); border: 1px solid var(--border); border-radius: 8px; padding: 1px 3px; box-shadow: 0 2px 6px rgba(15, 23, 42, .12); }
.tc-msg:hover .tc-acts { display: flex; }
.tc-acts button { border: 0; background: none; cursor: pointer; font-size: .8rem; padding: 2px 4px; border-radius: 5px; }
.tc-acts button:hover { background: var(--bg-alt, #f1f5f9); }
.tc-compose { padding: 10px 16px 12px; background: var(--card, #fff); border-top: 1px solid var(--border); }
.tc-box { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg, #fff); transition: border-color .15s, box-shadow .15s; }
.tc-box:focus-within { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(106, 60, 240, .12); }
.tc-input { flex: 1; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: .9rem; line-height: 1.45; padding: 5px 0; max-height: 140px; color: var(--text); }
.tc-tool { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: none; cursor: pointer; font-size: 1rem; opacity: .65; transition: opacity .15s, background .15s; }
.tc-tool:hover { opacity: 1; background: var(--bg-alt, #f1f5f9); }
.tc-pinbtn.on { opacity: 1; background: #fef3c7; box-shadow: inset 0 0 0 1px #f59e0b; }
.tc-send { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-size: .95rem; background: linear-gradient(135deg, #6a3cf0, #ff2d78); box-shadow: 0 4px 10px -4px rgba(106, 60, 240, .6); }
.tc-send:hover { filter: brightness(1.08); }
.tc-hint { display: block; margin-top: 5px; font-size: .7rem; color: var(--muted); }
.tc-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tv2-chat.tc-drag, .tc-wrap.tc-drag { outline: 2px dashed #a78bfa; outline-offset: -6px; }
:root[data-theme="dark"] .tc-msg.me .tc-bub { background: #2e2659; }
:root[data-theme="dark"] .tc-msg.pinned .tc-bub, :root[data-theme="dark"] .tc-pins { background: #2a2414; }
:root[data-theme="dark"] .tc-pin { background: #1f1a10; }
:root[data-theme="dark"] .tc-kpi { background: #1b1730; }
@media (max-width: 860px) { .tc-scroll { max-height: 60vh; } .tc-msg { max-width: 92%; } }
.tc-input { min-height: 34px; overflow-y: hidden; }
.tc-input::placeholder { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Vista general: panel integrado «📬 Por responder · 📰 Noticias» (correo de Outlook en solo lectura) ===== */
.news.hub .news-h { padding-top: 2px; }
.hub-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--bg-alt, #f1f5f9); }
.hub-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: .82rem; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.hub-tabs button b { color: inherit; font-weight: 600; }
.hub-tabs button small { color: var(--muted); font-size: .76rem; }
.hub-tabs button.on { background: var(--card, #fff); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.hub-tabs button.on b { color: var(--text); }
.hub-n { min-width: 18px; padding: 0 6px; border-radius: 999px; background: linear-gradient(135deg, #6a3cf0, #ff2d78); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.news-act { display: inline-flex; align-items: center; gap: 8px; }
.hub-meta { color: var(--muted); font-size: .76rem; }
.hub-outlook { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 8px; font-size: .78rem; font-weight: 600;
  color: #0f6cbd; background: rgba(15, 108, 189, .08); text-decoration: none; transition: background .15s; }
.hub-outlook:hover { background: rgba(15, 108, 189, .16); }
.hub-refresh.spin { animation: appReloadSpin .8s linear infinite; }
.hub-body { min-height: 84px; }
.mail-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 12px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.mail-card { flex: none; width: 330px; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; scroll-snap-align: start;
  border: 1px solid var(--border); background: var(--card, #fff); color: var(--text); text-decoration: none; position: relative;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
a.mail-card:hover { border-color: #a5b4fc; box-shadow: 0 6px 16px -10px rgba(15, 23, 42, .35); transform: translateY(-1px); }
.mail-card.unread { box-shadow: inset 3px 0 0 #0f6cbd; }
.mail-av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .74rem; font-weight: 700; }
.mail-txt { min-width: 0; flex: 1; display: grid; gap: 1px; }
.mail-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mail-top b { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-card.unread .mail-top b { color: #0f6cbd; }
.mail-wait { margin-left: auto; flex: none; font-size: .68rem; color: var(--muted); }
.mail-wait.w2 { color: #b45309; font-weight: 600; }
.mail-wait.w3 { color: #dc2626; font-weight: 700; }
.mail-txt strong { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-card:not(.unread) .mail-txt strong { font-weight: 500; }
.mail-prev { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-flag { margin-right: 4px; }
.mail-flag.imp { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 4px; background: #dc2626; color: #fff; font-size: .66rem; font-weight: 800; vertical-align: 1px; }
.mail-empty { display: flex; align-items: center; gap: 12px; margin: 4px 12px 8px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--border); font-size: .84rem; color: var(--muted); }
.mail-empty span:not(.mail-cta-ic):not(.mail-spin) { display: grid; gap: 2px; flex: 1; }
.mail-empty b { color: var(--text); font-size: .86rem; }
.mail-empty small { font-size: .76rem; }
.mail-empty.ok { border-style: solid; border-color: #bbf7d0; background: #f0fdf4; }
.mail-empty.cta { border-style: solid; background: linear-gradient(135deg, rgba(15, 108, 189, .06), rgba(106, 60, 240, .06)); }
.mail-cta-ic { font-size: 1.4rem; }
.mail-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: #0f6cbd; animation: appReloadSpin .8s linear infinite; }
:root[data-theme="dark"] .hub-tabs { background: #1b1730; }
:root[data-theme="dark"] .mail-card.unread .mail-top b, :root[data-theme="dark"] .hub-outlook { color: #60a5fa; }
:root[data-theme="dark"] .mail-empty.ok { background: #0f2a1a; border-color: #14532d; }
@media (max-width: 600px) { .mail-card { width: 270px; } .hub-tabs button small, .hub-meta { display: none; } }
.news.hub .mail-row { padding: 4px 16px 10px; }
.mail-row::-webkit-scrollbar { height: 6px; } .mail-row::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.mail-row:hover::-webkit-scrollbar-thumb { background: var(--border); }

/* Correos por responder: sección propia bajo las noticias, en dos columnas ordenadas + sugerencia */
.mail-sec { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.mail-h { padding-bottom: 8px; }
.mail-h .hub-n { margin-left: 8px; }
.mail-tip { display: flex; align-items: center; gap: 10px; margin: 0 14px 10px; padding: 9px 12px; border-radius: 10px; font-size: .82rem;
  background: linear-gradient(90deg, #fffbeb, #fff7ed); border: 1px solid #fde68a; color: #78350f; }
.mail-tip span { flex: 1; }
.mail-tip-go { flex: none; padding: 4px 12px; border-radius: 8px; background: #f59e0b; color: #fff; font-weight: 700; font-size: .78rem; text-decoration: none; }
.mail-tip-go:hover { filter: brightness(1.05); }
.mail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 14px 10px; }
.mail-col-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: .8rem; }
.mail-col-h small { color: var(--muted); font-size: .72rem; }
.mail-col.old .mail-col-h b { color: #b45309; }
.mail-list { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card, #fff); }
.mail-li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--border); transition: background .15s; position: relative; }
.mail-li:last-child { border-bottom: 0; }
a.mail-li:hover { background: rgba(15, 108, 189, .05); }
.mail-li.unread { box-shadow: inset 3px 0 0 #0f6cbd; }
.mail-li .mail-av { width: 30px; height: 30px; font-size: .68rem; }
.mail-li .mail-top { gap: 4px; }
.mail-li.unread .mail-top b { color: #0f6cbd; }
.mail-li .mail-txt strong { font-size: .82rem; }
.mail-li .mail-wait { margin-left: 0; padding: 2px 8px; border-radius: 999px; background: var(--bg-alt, #f1f5f9); white-space: nowrap; }
.mail-li .mail-wait.w2 { background: #fffbeb; }
.mail-li .mail-wait.w3 { background: #fef2f2; }
.mail-more { display: inline-block; margin-top: 6px; font-size: .76rem; color: #0f6cbd; text-decoration: none; font-weight: 600; }
.mail-none { margin: 0; padding: 12px; border: 1px dashed var(--border); border-radius: 12px; font-size: .8rem; color: var(--muted); text-align: center; }
.mail-sec .mail-empty { margin: 0 14px 10px; }
:root[data-theme="dark"] .mail-tip { background: #2a2414; border-color: #4a3a12; color: #fcd34d; }
@media (max-width: 900px) { .mail-cols { grid-template-columns: 1fr; } }

/* Te nombran: destacado · En copia: aparte, plegado y atenuado */
.mail-at { padding: 0 6px; border-radius: 999px; background: rgba(106, 60, 240, .12); color: #6a3cf0; font-size: .64rem; font-weight: 700; white-space: nowrap; }
.mail-li.named { background: linear-gradient(90deg, rgba(106, 60, 240, .05), transparent 60%); }
.mail-cc { margin: 0 14px 10px; }
.mail-cc summary { cursor: pointer; list-style: none; display: inline-flex; align-items: baseline; gap: 8px; font-size: .78rem; color: var(--muted); padding: 2px 0 6px; }
.mail-cc summary::-webkit-details-marker { display: none; }
.mail-cc summary::before { content: "▸"; font-size: .7rem; transition: transform .15s; }
.mail-cc[open] summary::before { transform: rotate(90deg); }
.mail-cc summary small { font-size: .72rem; }
.mail-li.cc { opacity: .72; }
.mail-li.cc:hover { opacity: 1; }
.mail-li.cc .mail-txt strong { font-weight: 500; }
:root[data-theme="dark"] .mail-at { color: #c4b5fd; background: rgba(167, 139, 250, .16); }

/* Correo vinculado: cliente/proyecto, acciones por correo, esperando respuesta de otros y métrica de respuesta */
.mail-client { padding: 0 7px; border-radius: 999px; background: rgba(15, 108, 189, .08); color: #0f6cbd; font-size: .64rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.mail-client[data-mact] { cursor: pointer; }
.mail-client[data-mact]:hover { background: rgba(15, 108, 189, .16); }
.mail-side { display: grid; justify-items: end; gap: 4px; }
.mail-acts { display: flex; gap: 3px; opacity: 0; transform: translateY(-2px); transition: opacity .15s, transform .15s; }
.mail-li:hover .mail-acts, .mail-li:focus-within .mail-acts { opacity: 1; transform: none; }
.mail-acts button { border: 1px solid var(--border); background: var(--card, #fff); border-radius: 7px; padding: 2px 7px; font: inherit; font-size: .7rem; font-weight: 600; cursor: pointer; color: var(--text); white-space: nowrap; }
.mail-acts button:hover { border-color: #a78bfa; color: #6a3cf0; }
.mail-waiting summary { color: #b45309; }
.mail-av.out { background: #fef3c7 !important; color: #b45309; font-size: .9rem; }
.mail-follow { font-size: .7rem; font-weight: 700; color: #b45309; white-space: nowrap; }
.hub-metric { padding: 2px 9px; border-radius: 999px; background: rgba(34, 197, 94, .1); color: #15803d; font-size: .72rem; font-weight: 600; }
.tv2-mail { color: #0f6cbd; font-weight: 600; text-decoration: none; }
.tv2-mail:hover { text-decoration: underline; }
@media (hover: none) { .mail-acts { opacity: 1; transform: none; } }
:root[data-theme="dark"] .mail-client, :root[data-theme="dark"] .tv2-mail { color: #60a5fa; }

/* ===== Lector de correo (estilo panel de lectura de Outlook) ===== */
dialog.mv-wide { width: min(1080px, 100% - 32px); height: calc(100vh - 48px); max-height: calc(100vh - 48px); padding: 0; overflow: hidden; }
dialog.mv-wide #genBody, dialog.mv-wide #genBody > .mv { height: 100%; }
.mv { display: flex; flex-direction: column; min-height: 0; background: var(--card, #fff); }
.mv-loading { margin: auto; padding: 40px; display: flex; gap: 10px; align-items: center; color: var(--muted); }
.mv-head { display: flex; align-items: flex-start; gap: 14px; padding: 16px 20px 10px; border-bottom: 1px solid var(--border); }
.mv-head h3 { flex: 1; margin: 0; font-size: 1.15rem; line-height: 1.35; }
.mv-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.mv-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--card, #fff);
  color: var(--text); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.mv-btn:hover { background: var(--bg-alt, #f1f5f9); }
.mv-btn.primary { background: #0f6cbd; border-color: #0f6cbd; color: #fff; }
.mv-btn.primary:hover { background: #115ea3; }
.mv-from { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; }
.mv-from .mail-av { width: 40px; height: 40px; font-size: .82rem; }
.mv-who { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mv-who b { font-size: .92rem; }
.mv-who small { color: var(--muted); font-size: .76rem; }
.mv-addr { color: var(--muted); font-weight: 400; font-size: .8rem; }
.mv-from time { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.mv-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 10px; }
.mv-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: .78rem; color: var(--text); text-decoration: none; max-width: 280px; }
.mv-file b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-file small { color: var(--muted); }
.mv-file:hover { border-color: #0f6cbd; }
.mv-body { flex: 1; min-height: 200px; width: 100%; border: 0; border-top: 1px solid var(--border); background: #fff; }
.mv.replying .mv-body { flex: 1 1 40%; }
.mv-reply { border-top: 2px solid #0f6cbd; padding: 10px 20px 14px; background: var(--card, #fff); display: grid; gap: 8px; }
.mv-reply-to { font-size: .82rem; color: var(--muted); }
.mv-reply-to b { color: #0f6cbd; }
.mv-reply textarea { resize: vertical; min-height: 110px; font-size: .9rem; }
.mv-reply-bar { display: flex; align-items: center; gap: 8px; }
.mv-reply-bar small { flex: 1; font-size: .72rem; }
@media (max-width: 760px) { .mv-head { flex-direction: column; } .mv-tools { justify-content: flex-start; } .mv-reply-bar small { display: none; } }

/* «Ver todos» los correos: ventana con pestañas por sección y buscador */
.mail-all { font-size: .72rem; font-weight: 700; color: #0f6cbd; }
.mail-more { margin-top: 6px; border: 0; background: none; padding: 0; font: inherit; font-size: .76rem; color: #0f6cbd; font-weight: 600; cursor: pointer; }
.mail-more:hover { text-decoration: underline; }
.hub-all { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card, #fff); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; color: var(--text); }
.hub-all:hover { border-color: #0f6cbd; color: #0f6cbd; }
dialog.ml-wide { width: min(980px, 100% - 32px); height: calc(100vh - 48px); max-height: calc(100vh - 48px); padding: 0; overflow: hidden; }
dialog.ml-wide #genBody, dialog.ml-wide .ml { height: 100%; }
.ml { display: flex; flex-direction: column; min-height: 0; }
.ml-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 10px; }
.ml-head h3 { margin: 0; font-size: 1.1rem; white-space: nowrap; }
.ml-search { flex: 1; max-width: 420px; margin-left: auto; }
.ml-tabs { display: flex; gap: 4px; padding: 0 20px 10px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.ml-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card, #fff);
  font: inherit; font-size: .8rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ml-tabs button span { padding: 0 6px; border-radius: 999px; background: var(--bg-alt, #f1f5f9); font-size: .7rem; font-weight: 700; }
.ml-tabs button.on { background: #0f6cbd; border-color: #0f6cbd; color: #fff; }
.ml-tabs button.on span { background: rgba(255, 255, 255, .25); }
.ml-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 20px; }
.ml-body .mail-li .mail-acts { opacity: .9; }
.ml-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--border); }
.ml-group { padding: 8px 14px 6px; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--bg-alt, #f8fafc); border-bottom: 1px solid var(--border); }

/* Lector: firma de correo y ajuste de alto (sin espacio en blanco bajo la respuesta) */
dialog.mv-wide #genBody { display: flex; flex-direction: column; }
dialog.mv-wide #genBody > .mv { flex: 1; height: auto; min-height: 0; overflow: hidden; }
.mv-body { flex: 1 1 0; }
.mv.replying .mv-body { flex: 1 1 0; min-height: 160px; }
.mv-reply { flex: none; max-height: 62%; overflow-y: auto; }
.mv-reply textarea { min-height: 90px; }
.mv-sig { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .8rem; }
.mv-sig-prev { flex-basis: 100%; padding: 4px 12px 8px; border-left: 3px solid #e5e7eb; background: #fff; border-radius: 6px; color: #374151; }
.mv-sig-prev[hidden] { display: none; }
.mv-sig-form { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-alt, #f8fafc); }
.mv-sig-form label { display: grid; gap: 3px; font-size: .74rem; color: var(--muted); }
.mv-sig-form label.check { display: flex; align-items: center; gap: 6px; align-self: end; }
.mv-sig-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
button.mail-tip-go { border: 0; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 700; }
.mv-sig-prev table { width: auto !important; border: 0; } .mv-sig-prev td { border-bottom: 0; }

/* ✨ Sugerencias de respuesta con IA */
.mv-btn.ai { border-color: #c4b5fd; color: #6a3cf0; background: linear-gradient(135deg, rgba(106, 60, 240, .08), rgba(255, 45, 120, .06)); }
.mv-btn.ai:hover { background: linear-gradient(135deg, rgba(106, 60, 240, .16), rgba(255, 45, 120, .1)); }
.mv-ai { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid #ddd6fe; background: linear-gradient(135deg, #faf8ff, #fff7fb); }
.mv-ai-load { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: #6a3cf0; }
.mv-ai-ask { margin: 0; font-size: .82rem; color: #4c1d95; }
.mv-ai-err { margin: 0; font-size: .82rem; color: #b91c1c; }
.mv-ai-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mv-ai-card { display: grid; gap: 4px; align-content: start; text-align: left; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: #fff;
  font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.mv-ai-card:hover, .mv-ai-card.on { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(106, 60, 240, .1); }
.mv-ai-card b { font-size: .74rem; color: #6a3cf0; text-transform: uppercase; letter-spacing: .04em; }
.mv-ai-card span { font-size: .78rem; color: #374151; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mv-ai-card small { font-size: .7rem; color: #6a3cf0; font-weight: 600; }
:root[data-theme="dark"] .mv-ai { background: #1b1533; border-color: #3b2f6b; }
:root[data-theme="dark"] .mv-ai-card { background: #141026; }
:root[data-theme="dark"] .mv-ai-card span { color: #d1d5db; }
@media (max-width: 760px) { .mv-ai-list { grid-template-columns: 1fr; } }

/* Actividades › Proyectos: proyectos sin actividades asignadas (compactos, al final) */
.pb-rest { opacity: .95; }
.pb-rest-h { display: grid; gap: 2px; padding: 14px 18px 8px; }
.pb-rest-h small { color: var(--muted); }
.pb-rest .pg-item { cursor: pointer; }

/* Lector de correo y «Ver todos»: el contenido ocupa todo el alto de la ventana (el correo no queda en una franja chica) */
dialog.mv-wide[open], dialog.ml-wide[open] { display: flex; flex-direction: column; }
dialog.mv-wide #genBody, dialog.ml-wide #genBody { flex: 1 1 auto; min-height: 0; height: auto; max-height: none; overflow: hidden; display: flex; flex-direction: column; }
dialog.mv-wide #genBody > .mv, dialog.ml-wide #genBody > .ml { flex: 1 1 auto; min-height: 0; height: auto; }
.mv-body { flex: 1 1 auto; min-height: 240px; height: auto; }
.mv.replying .mv-body { min-height: 200px; }
.mv-sig-src { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .8rem; }
.mv-sig-or { grid-column: 1 / -1; color: var(--muted); font-size: .72rem; }
.mv-sig-prev img { max-width: 100%; height: auto; }

.integ-ai { display: grid; gap: 6px; margin: 10px 0 4px; max-width: 760px; }
.integ-ai label { display: grid; gap: 4px; font-size: .84rem; font-weight: 600; }
.integ-ai small code { font-size: .72rem; }
.mv-ai-by { justify-self: end; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8b5cf6; }
.mv-ai-err .btn { margin-left: 6px; }

/* Al abrir: el contenido aparece cuando llegan los datos (sin mostrar antes una pantalla vacía) */
body.kx-booting .main > :not(.topbar) { opacity: 0; }
.main > :not(.topbar) { transition: opacity .18s ease; }
body.kx-booting .main::after { content: ""; position: fixed; top: 50%; left: calc(50% + 120px); width: 28px; height: 28px; margin: -14px;
  border-radius: 50%; border: 3px solid rgba(106, 60, 240, .18); border-top-color: #6a3cf0; animation: appReloadSpin .8s linear infinite; }

/* Silueta del panel de noticias y correo mientras carga (evita que la página salte) */
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, rgba(148, 163, 184, .14), rgba(148, 163, 184, .28), rgba(148, 163, 184, .14));
  background-size: 200% 100%; animation: skShine 1.3s ease-in-out infinite; }
@keyframes skShine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-t { width: 220px; height: 14px; }
.sk-line { height: 12px; margin: 4px 14px 8px; }
.sk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 4px 14px 12px; }
.sk-card { height: 70px; border-radius: 10px; }
.sk-col { display: grid; gap: 8px; }
.sk-li { height: 58px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* Sugerencias de respuesta con Claude */
.mv-ai-pick { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--muted); }
.mv-ai-pick button { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: .74rem; font-weight: 600; color: var(--text); cursor: pointer; }
.mv-ai-pick button.on { background: #6a3cf0; border-color: #6a3cf0; color: #fff; }
.mv-ai { grid-template-columns: 1fr auto; }
.mv-ai > :not(.mv-ai-pick):not(.mv-ai-by) { grid-column: 1 / -1; }
.ai-ic { vertical-align: -3px; flex: none; }
.mv-ai-pick button { display: inline-flex; align-items: center; gap: 5px; }
.mv-ai-pick button.on .ai-ic g { fill: #fff; }
.mv-ai-by { display: inline-flex; align-items: center; gap: 5px; }
.mv > * { flex-shrink: 0; }

/* Integraciones → 🎂 Saludos */
.greet .greet-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 10px; }
.greet-mode { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card, #fff); font: inherit; cursor: pointer; color: var(--text); }
.greet-mode small { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.greet-mode.on { border-color: #6a3cf0; box-shadow: 0 0 0 3px rgba(106, 60, 240, .12); background: #faf8ff; }
.greet-editor { display: grid; gap: 10px; margin-top: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; }
.greet-editor label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; }
.greet-tabs { display: flex; gap: 6px; }
.greet-tabs button { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card, #fff); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--text); }
.greet-tabs button.on { background: #ff2d78; border-color: #ff2d78; color: #fff; }
.greet-list { margin-top: 16px; }
.greet-list h4 { margin: 0 0 8px; }
.greet-table { width: 100%; border-collapse: collapse; }
.greet-table td { padding: 8px 8px; border-top: 1px solid var(--border); vertical-align: middle; font-size: .86rem; }
.greet-table td small { display: block; color: var(--muted); font-size: .74rem; }
.greet-table tr.today td { background: #fff1f7; }
.greet-table .g-when { white-space: nowrap; font-weight: 600; width: 1%; }
.greet-table .g-act { text-align: right; white-space: nowrap; width: 1%; }
.greet-table .input.sm { min-width: 210px; }
:root[data-theme="dark"] .greet-mode.on { background: #1b1533; }
:root[data-theme="dark"] .greet-table tr.today td { background: #2a1424; }
@media (max-width: 760px) { .greet .greet-modes { grid-template-columns: 1fr; } .greet-table .input.sm { min-width: 140px; } }
/* Saludos: pestañas con el modo de cada uno y botón Guardar con estado */
.greet .greet-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 0; }
.greet-tab { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 14px; border-radius: 12px 12px 0 0; border: 1px solid var(--border); border-bottom: 0;
  background: var(--bg-alt, #f4f6fb); font: inherit; cursor: pointer; color: var(--muted); }
.greet-tab .gt-ic { font-size: 1.3rem; }
.greet-tab b { display: block; color: var(--text); font-size: .9rem; }
.greet-tab small { font-size: .74rem; font-weight: 700; }
.greet-tab small.gm-auto { color: #15803d; } .greet-tab small.gm-manual { color: #b45309; } .greet-tab small.gm-off { color: var(--muted); }
.greet-tab.on { background: var(--card, #fff); box-shadow: inset 0 3px 0 #ff2d78; color: var(--text); }
.greet .greet-editor { margin-top: 0; border-radius: 0 0 14px 14px; }
.greet-sub { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.greet .greet-modes { margin: 0; }
.greet-actions { align-items: center; }
.btn.saved { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; opacity: 1; cursor: default; }
.greet-pending { color: #b45309; font-size: .78rem; font-weight: 600; }
.g-auto { display: block; margin-bottom: 3px; font-size: .7rem; }
.greet .greet-tabs .greet-tab { border-radius: 12px 12px 0 0; }
.greet .greet-tabs .greet-tab.on { background: var(--card, #fff); color: var(--text); border-color: var(--border); box-shadow: inset 0 3px 0 #ff2d78; }

/* Mis asignaciones: tareas cerradas aparte, plegadas al final */
#listBody tr.done-sep td { background: var(--bg-alt); padding: 8px 14px; border-top: 1px solid var(--border); cursor: pointer; }
#listBody tr.done-sep small { color: var(--muted); margin-left: 6px; font-size: .76rem; }
.done-sep-btn { border: 0; background: none; font: inherit; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 6px; }
.done-sep-btn:hover { color: var(--text); }
.done-sep-btn .ds-count { background: #e7f6ec; color: #1f7a3d; border-radius: 999px; padding: 1px 8px; font-size: .72rem; letter-spacing: 0; }
:root[data-theme="dark"] .done-sep-btn .ds-count { background: #173323; color: #7bd69a; }
#listBody tr.done-sep ~ tr:not(.pa-sep):not(.pg-row) .t-title { opacity: .8; }

/* ===== Foro: incidentes y soluciones ===== */
.fm-hero { display: flex; align-items: center; gap: 18px; justify-content: space-between; padding: 18px 22px; border-radius: 16px; margin-bottom: 14px;
  background: linear-gradient(120deg, #2e1a6e 0%, #4b2bb3 60%, #6a3cf0 100%); color: #fff; }
.fm-hero h3 { margin: 0 0 4px; font-size: 1.05rem; }
.fm-hero p { margin: 0; opacity: .85; font-size: .86rem; max-width: 640px; }
.fm-hero .btn-primary { background: #fff; color: #2e1a6e; border-color: #fff; white-space: nowrap; }
.fm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.fm-kpis > div { background: var(--card, #fff); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; display: grid; gap: 2px; }
.fm-kpis b { font-size: 1.5rem; line-height: 1.1; }
.fm-kpis span { color: var(--muted); font-size: .78rem; }
.fm-kpis .ok b { color: #1f7a3d; } .fm-kpis .warn b { color: #c2610c; }
.fm-toolbar { flex-wrap: wrap; gap: 8px; }
.fm-toolbar #fmSearch { flex: 1 1 260px; }
.fm-list { display: grid; gap: 10px; }
.fm-card { display: flex; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--card, #fff); cursor: pointer;
  border-left: 4px solid #f0a23b; transition: box-shadow .15s, transform .15s; }
.fm-card.solved { border-left-color: #22a35a; }
.fm-card:hover, .fm-card:focus-visible { box-shadow: 0 6px 22px rgba(46, 26, 110, .10); transform: translateY(-1px); outline: none; }
.fm-card-main { flex: 1; min-width: 0; }
.fm-card h4 { margin: 6px 0 4px; font-size: .98rem; }
.fm-ex { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.fm-sol { margin: 6px 0 0; font-size: .83rem; background: #eefaf2; color: #1d5e35; border-radius: 8px; padding: 6px 10px; }
.fm-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fm-status { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.fm-status.ok { background: #e7f6ec; color: #1f7a3d; } .fm-status.warn { background: #fff1e0; color: #b45309; }
.fm-type { font-size: .74rem; color: var(--muted); }
.fm-code { font-size: .72rem; background: var(--bg-alt); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.fm-client { font-size: .74rem; color: var(--muted); }
.fm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: .76rem; color: var(--muted); }
.fm-meta .grow, .fm-actions .grow { flex: 1; }
.fm-tag { font-size: .72rem; color: #5b3fd1; background: #f1edff; border-radius: 999px; padding: 1px 8px; }
.fm-view h3 { margin: 6px 0 2px; }
.fm-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 14px; align-items: start; }
.fm-col { display: grid; gap: 12px; min-width: 0; }
.fm-block { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.fm-block h5 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fm-text { white-space: pre-wrap; font-size: .9rem; line-height: 1.55; overflow-wrap: anywhere; }
.fm-block.solution { border-color: #9fdcb5; background: #f3fbf6; }
.fm-block.solution h5 { color: #1f7a3d; }
.fm-block.solution.empty { border-style: dashed; background: none; border-color: var(--border); }
.fm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fm-actions .btn.on { border-color: #6a3cf0; color: #4b2bb3; }
.fm-actions .danger { color: #c0262d; }
.fm-comments .thread { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; position: sticky; top: 0; }
.fm-comments .thread-list { max-height: 52vh; overflow: auto; }
.fm-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.fm-form-grid label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; }
.fm-form-grid .span2 { grid-column: span 2; }
:root[data-theme="dark"] .fm-sol, :root[data-theme="dark"] .fm-block.solution { background: #13281c; color: #a7e3bd; border-color: #24553a; }
:root[data-theme="dark"] .fm-status.ok { background: #173323; color: #7bd69a; } :root[data-theme="dark"] .fm-status.warn { background: #3a2610; color: #f3b56b; }
:root[data-theme="dark"] .fm-tag { background: #241d44; color: #b9a8ff; }
@media (max-width: 860px) { .fm-grid, .fm-form-grid { grid-template-columns: 1fr; } .fm-form-grid .span2 { grid-column: auto; } .fm-kpis { grid-template-columns: repeat(2, 1fr); } .fm-hero { flex-direction: column; align-items: flex-start; } }
#genDialog .fm-view, #genDialog .fm-form { padding: 22px 26px 18px; }
.fm-view .meet-head { padding-right: 40px; }

/* Foro: adjuntos, autor y participantes */
.fm-thumbs { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.fm-thumbs img { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.fm-thumbs span { font-size: .78rem; color: var(--muted); }
.fm-stack { display: inline-flex; align-items: center; }
.fm-stack .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--card, #fff); }
.fm-stack .av:first-child { margin-left: 0; }
.fm-more { margin-left: 4px; font-size: .72rem; color: var(--muted); }
.fm-byline { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.fm-byline > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.fm-byline small { flex-basis: 100%; }
.fm-badge { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #4b2bb3; background: #f1edff; border-radius: 999px; padding: 1px 7px; }
.fm-people-box { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.fm-people-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: .84rem; }
.fm-people { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-person { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--bg-alt); }
.fm-person span { display: grid; line-height: 1.15; }
.fm-person b { font-size: .78rem; } .fm-person small { font-size: .68rem; color: var(--muted); }
.fm-comments { gap: 10px; }
.fm-comments .thread { position: static; display: grid; gap: 8px; }
.fm-clist { display: grid; gap: 10px; max-height: 44vh; overflow: auto; padding-right: 4px; }
.fm-c { display: flex; gap: 8px; align-items: flex-start; }
.fm-c-body { flex: 1; min-width: 0; background: var(--bg-alt); border-radius: 4px 12px 12px 12px; padding: 8px 12px; }
.fm-c.by-author .fm-c-body { background: #f4f0ff; border: 1px solid #e2d9ff; }
.fm-c-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: .82rem; }
.fm-c-time { margin-left: auto; }
.fm-c-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .75rem; padding: 0 2px; opacity: 0; }
.fm-c:hover .fm-c-del, .fm-c-del:focus-visible { opacity: 1; }
.fm-c-text { white-space: pre-wrap; font-size: .87rem; line-height: 1.5; overflow-wrap: anywhere; margin-top: 2px; }
.fm-c .att { margin-top: 6px; }
.fm-c-empty { padding: 6px 0; }
.fm-compose { border-top: 1px solid var(--border); padding-top: 10px; display: grid; gap: 8px; border-radius: 10px; }
.fm-compose.drag, .fm-attach.drag { outline: 2px dashed #6a3cf0; outline-offset: 4px; background: #faf8ff; }
.fm-compose-me { display: flex; gap: 8px; align-items: flex-start; }
.fm-compose-me textarea { flex: 1; resize: vertical; }
.fm-compose-tools { display: flex; align-items: center; gap: 8px; }
.fm-compose-tools small { flex: 1; font-size: .72rem; }
.fm-pending, .fm-attach-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fm-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px 4px 10px; }
.fm-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: .8rem; }
.fm-chip.img { position: relative; padding: 0; overflow: hidden; }
.fm-chip.img img { width: 84px; height: 60px; object-fit: cover; display: block; }
.fm-chip.img button { position: absolute; top: 3px; right: 3px; background: rgba(0, 0, 0, .55); color: #fff; border-radius: 50%; width: 20px; height: 20px; line-height: 20px; padding: 0; }
.fm-attach { border: 1px dashed var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; }
.fm-attach-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fm-attach-head > div { display: grid; gap: 2px; }
.fm-attach-head b { font-size: .82rem; } .fm-attach-head small { font-size: .74rem; color: var(--muted); font-weight: 400; }
:root[data-theme="dark"] .fm-c.by-author .fm-c-body { background: #211a3d; border-color: #3a2f6b; }
:root[data-theme="dark"] .fm-badge { background: #241d44; color: #b9a8ff; }
:root[data-theme="dark"] .fm-compose.drag, :root[data-theme="dark"] .fm-attach.drag { background: #1b1533; }

/* Foro: formulario por pasos */
#genDialog .fm-form2 { padding: 0; }
.fm-fhead { display: flex; align-items: center; gap: 14px; padding: 20px 64px 18px 26px; background: linear-gradient(120deg, #2e1a6e, #5a35d6); color: #fff; }
.fm-fhead h3 { margin: 0; font-size: 1.08rem; } .fm-fhead small { opacity: .82; font-size: .82rem; }
.fm-fhead-ic { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.fm-fbody { padding: 8px 26px 4px; }
.fm-step { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.fm-step:last-child { border-bottom: 0; }
.fm-step-n { width: 28px; height: 28px; border-radius: 50%; background: #f1edff; color: #4b2bb3; font-weight: 700; font-size: .84rem; display: grid; place-items: center; flex-shrink: 0; }
.fm-step.sol .fm-step-n { background: #e7f6ec; color: #1f7a3d; }
.fm-step-c { flex: 1; min-width: 0; display: grid; gap: 12px; }
.fm-step-c h4 { margin: 3px 0 0; font-size: .95rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fm-field { display: grid; gap: 5px; }
.fm-field > span { font-size: .8rem; font-weight: 600; color: var(--text); }
.fm-field em { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 4px; font-size: .74rem; }
.fm-field > small { color: var(--muted); font-size: .74rem; }
.fm-title-in { font-size: 1rem; font-weight: 600; padding: 11px 14px; }
.fm-miss { border-color: #e0434b !important; box-shadow: 0 0 0 3px rgba(224, 67, 75, .12) !important; }
.fm-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fm-type-card { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.fm-type-card input { position: absolute; opacity: 0; pointer-events: none; }
.fm-type-card b { font-size: .86rem; } .fm-type-card small { color: var(--muted); font-size: .74rem; line-height: 1.35; }
.fm-type-card:hover { border-color: #b9a8ff; }
.fm-type-card.on { border-color: #6a3cf0; box-shadow: 0 0 0 3px rgba(106, 60, 240, .12); background: #faf8ff; }
.fm-type-card:focus-within { outline: 2px solid #6a3cf0; outline-offset: 2px; }
.fm-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fm-state { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.fm-state.ok { background: #e7f6ec; color: #1f7a3d; } .fm-state.warn { background: #fff1e0; color: #b45309; }
.fm-attach-head { justify-content: flex-start; }
.fm-attach-head > div { flex: 1; }
.fm-attach-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--bg-alt); display: grid; place-items: center; }
.fm-ffoot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 14px 26px; border-top: 1px solid var(--border); background: var(--card, #fff); }
.fm-as { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.fm-ffoot .grow { flex: 1; }
:root[data-theme="dark"] .fm-type-card.on { background: #1b1533; }
:root[data-theme="dark"] .fm-step-n { background: #241d44; color: #b9a8ff; }
:root[data-theme="dark"] .fm-state.ok { background: #173323; color: #7bd69a; } :root[data-theme="dark"] .fm-state.warn { background: #3a2610; color: #f3b56b; }
@media (max-width: 760px) { .fm-types, .fm-row3 { grid-template-columns: 1fr; } .fm-fbody, .fm-ffoot { padding-left: 16px; padding-right: 16px; } }

/* Foro: ventana grande y ordenada, con el estado «Solucionado» al frente */
#genDialog.fm-big { width: min(1280px, 96vw); max-width: 96vw; max-height: 94vh; padding: 0; }
#genDialog.fm-big .fm-view2 { padding: 0; }
.fm-vhead { display: flex; gap: 24px; align-items: flex-start; padding: 24px 72px 20px 30px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #faf8ff, var(--card, #fff)); }
.fm-vhead.ok { box-shadow: inset 4px 0 0 #22a35a; } .fm-vhead.warn { box-shadow: inset 4px 0 0 #f0a23b; }
.fm-vhead-main { flex: 1; min-width: 0; }
.fm-vhead h2 { margin: 8px 0 12px; font-size: 1.5rem; line-height: 1.25; letter-spacing: -.01em; }
.fm-hactions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; padding-top: 2px; }
.fm-more-menu { position: relative; }
.fm-more-menu summary { list-style: none; cursor: pointer; }
.fm-more-menu summary::-webkit-details-marker { display: none; }
.fm-more-menu > div { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; display: grid; min-width: 230px; padding: 6px; border-radius: 12px;
  background: var(--card, #fff); border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(20, 10, 60, .16); }
.fm-more-menu > div button { text-align: left; border: 0; background: none; font: inherit; font-size: .86rem; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--text); }
.fm-more-menu > div button:hover { background: var(--bg-alt); }
.fm-more-menu > div .danger { color: #c0262d; }
.fm-vbody { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); }
.fm-vmain { padding: 24px 30px 28px; display: grid; gap: 18px; align-content: start; min-width: 0; }
.fm-vside { padding: 20px 24px 24px; border-left: 1px solid var(--border); background: var(--bg-alt); display: grid; gap: 14px; align-content: start; min-width: 0; }
.fm-vside .fm-people-box, .fm-vside .fm-thread { background: var(--card, #fff); }
.fm-vside .fm-thread { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.fm-vside .fm-clist { max-height: 46vh; }
.fm-solved, .fm-unsolved { border-radius: 16px; padding: 18px 22px; display: grid; gap: 14px; }
.fm-solved { background: linear-gradient(135deg, #effaf3, #f7fdf9); border: 1px solid #a6dfbb; }
.fm-unsolved { background: #fff8ef; border: 1px solid #f6d3a3; }
.fm-solved-h { display: flex; align-items: center; gap: 14px; }
.fm-solved-h > div { flex: 1; display: grid; gap: 2px; }
.fm-solved-h b { font-size: 1.15rem; }
.fm-solved b { color: #17663a; } .fm-unsolved b { color: #9a4a06; }
.fm-solved-h small { color: var(--muted); font-size: .82rem; }
.fm-solved-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; color: #fff; background: #22a35a; flex-shrink: 0; }
.fm-unsolved .fm-solved-ic { background: #f0a23b; }
.fm-solved-text { white-space: pre-wrap; font-size: 1rem; line-height: 1.65; color: var(--text); background: var(--card, #fff); border-radius: 12px; padding: 16px 18px; border: 1px solid #cdebd8; overflow-wrap: anywhere; }
.fm-context { display: grid; gap: 10px; }
.fm-context h5 { margin: 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fm-context-grid { display: grid; gap: 12px; }
.fm-context-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fm-context-grid > div { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.fm-k { font-size: .78rem; font-weight: 700; color: var(--muted); }
.fm-context .fm-text { font-size: .92rem; }
.fm-sol { display: grid; gap: 4px; margin: 2px 0 0; font-size: .88rem; line-height: 1.5; background: #eefaf2; color: #1d5e35; border-radius: 10px; padding: 10px 12px; border: 1px solid #cdebd8; }
.fm-sol-k { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #1f7a3d; }
:root[data-theme="dark"] .fm-vhead { background: linear-gradient(180deg, #1a1530, var(--card)); }
:root[data-theme="dark"] .fm-solved { background: #11261a; border-color: #24553a; } :root[data-theme="dark"] .fm-solved b { color: #8fe0ad; }
:root[data-theme="dark"] .fm-solved-text { background: #0f1f16; border-color: #24553a; }
:root[data-theme="dark"] .fm-unsolved { background: #2a1d0c; border-color: #5a3a12; } :root[data-theme="dark"] .fm-unsolved b { color: #f3b56b; }
:root[data-theme="dark"] .fm-sol { background: #13281c; color: #a7e3bd; border-color: #24553a; }
@media (max-width: 900px) { .fm-vbody, .fm-context-grid.two { grid-template-columns: 1fr; } .fm-vside { border-left: 0; border-top: 1px solid var(--border); }
  .fm-vhead { flex-direction: column; padding: 20px 56px 16px 20px; } .fm-vmain { padding: 18px 20px; } }
.fm-view2 .btn-sm { padding: 7px 14px; font-size: .84rem; border-radius: 10px; }
/* Foro: ventana casi a pantalla completa */
#genDialog.fm-big { width: min(1680px, 96vw); height: 92vh; max-height: 92vh; overflow: auto; }
#genDialog.fm-big #genBody { min-height: 100%; display: flex; flex-direction: column; }
#genDialog.fm-big .fm-view2 { flex: 1; display: flex; flex-direction: column; }
#genDialog.fm-big .fm-vbody { flex: 1; }
#genDialog.fm-big .fm-form2 { flex: 1; display: flex; flex-direction: column; }
#genDialog.fm-big .fm-fbody { flex: 1; }
.fm-vhead h2 { font-size: 1.75rem; }
.fm-vmain { padding: 28px 36px 32px; gap: 22px; }
.fm-vhead { padding: 28px 80px 24px 36px; }
.fm-solved-text { font-size: 1.05rem; padding: 18px 22px; }
.fm-context .fm-text { font-size: .96rem; }
.fm-vside { padding: 24px 28px 28px; }
.fm-vside .fm-clist { max-height: calc(92vh - 420px); min-height: 160px; }

/* ===== Foro: vista de hilo (publicación arriba, respuestas hacia abajo) ===== */
.fm-view3 { display: flex; flex-direction: column; min-height: 100%; }
.fm-thead { padding: 26px 80px 0 36px; background: linear-gradient(180deg, #faf8ff, var(--card, #fff)); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 3; }
.fm-thead h2 { margin: 8px 0 12px; font-size: 1.6rem; line-height: 1.25; letter-spacing: -.01em; }
.fm-tbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0 12px; }
.fm-tbar-info { display: inline-flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); }
.fm-tbar .grow { flex: 1; }
.fm-jump { color: #1f7a3d; font-weight: 600; text-decoration: none; }
.fm-posts { padding: 22px 36px 32px; display: grid; gap: 14px; background: var(--bg-alt); flex: 1; align-content: start; }
.fm-post { display: grid; grid-template-columns: 190px minmax(0, 1fr); background: var(--card, #fff); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 10, 60, .04); scroll-margin: 160px; transition: box-shadow .3s; }
.fm-post.flash { box-shadow: 0 0 0 3px rgba(34, 163, 90, .45); }
.fm-pa { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 20px 14px; border-right: 1px solid var(--border); background: linear-gradient(180deg, #fbfaff, var(--card, #fff)); }
.fm-pa-av .av { width: 72px; height: 72px; font-size: 1.4rem; }
.fm-pa-av .av.photo img { width: 72px; height: 72px; }
.fm-pa-name { margin-top: 6px; font-size: .95rem; }
.fm-pa-role { color: var(--muted); font-size: .76rem; line-height: 1.3; }
.fm-pa-stats { display: flex; gap: 8px; margin-top: 6px; font-size: .74rem; color: var(--muted); }
.fm-pb { padding: 16px 22px 18px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.fm-ph { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.fm-ph > span:first-child { flex: 1; }
.fm-num { font-weight: 700; color: #4b2bb3; text-decoration: none; }
.fm-pcontent { display: grid; gap: 6px; }
.fm-pcontent h5 { margin: 8px 0 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fm-pcontent h5:first-child { margin-top: 0; }
.fm-pcontent .fm-text, .fm-rtext { font-size: .97rem; line-height: 1.65; }
.fm-post.main { border-color: #d9d0ff; }
.fm-post.main .fm-pa { background: linear-gradient(180deg, #f4f0ff, var(--card, #fff)); }
.fm-answer { border-radius: 14px; padding: 16px 18px; background: linear-gradient(135deg, #effaf3, #f7fdf9); border: 1px solid #a6dfbb; display: grid; gap: 12px; }
.fm-answer-h { display: flex; align-items: center; gap: 12px; }
.fm-answer-h > div { flex: 1; display: grid; gap: 1px; }
.fm-answer-h b { color: #17663a; font-size: 1.1rem; }
.fm-answer-h small { color: var(--muted); font-size: .8rem; }
.fm-answer-text { white-space: pre-wrap; font-size: 1.02rem; line-height: 1.65; background: var(--card, #fff); border: 1px solid #cdebd8; border-radius: 10px; padding: 14px 16px; overflow-wrap: anywhere; }
.fm-pending-sol { display: flex; align-items: center; gap: 12px; border-radius: 14px; padding: 14px 18px; background: #fff8ef; border: 1px solid #f6d3a3; }
.fm-pending-sol > div { flex: 1; display: grid; gap: 1px; }
.fm-pending-sol b { color: #9a4a06; } .fm-pending-sol small { color: var(--muted); font-size: .8rem; }
.fm-pending-sol .fm-solved-ic { background: #f0a23b; }
.fm-replies-h { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 4px 0; }
.fm-post.is-solution { border: 2px solid #22a35a; box-shadow: 0 6px 22px rgba(34, 163, 90, .15); }
.fm-post.is-solution .fm-pa { background: linear-gradient(180deg, #eefaf2, var(--card, #fff)); }
.fm-sol-badge { font-size: .74rem; font-weight: 800; color: #fff; background: #22a35a; border-radius: 999px; padding: 3px 10px; }
.fm-post.by-author:not(.is-solution) { border-color: #e2d9ff; }
.fm-pf { display: flex; flex-wrap: wrap; gap: 14px; justify-content: flex-end; font-size: .8rem; padding-top: 4px; }
.fm-pf .link-btn.danger { color: #c0262d; }
.fm-pf [data-fm-accept]:not([data-fm-accept=""]) { color: #1f7a3d; font-weight: 600; }
.fm-post.compose { border-style: dashed; }
.fm-post.compose .fm-pa { opacity: .9; }
.fm-post.compose textarea { resize: vertical; min-height: 96px; }
.fm-post.compose .fm-compose { border-top: 0; padding-top: 16px; }
:root[data-theme="dark"] .fm-thead { background: linear-gradient(180deg, #1a1530, var(--card)); }
:root[data-theme="dark"] .fm-pa, :root[data-theme="dark"] .fm-post.main .fm-pa { background: #17132a; }
:root[data-theme="dark"] .fm-answer { background: #11261a; border-color: #24553a; } :root[data-theme="dark"] .fm-answer-h b { color: #8fe0ad; }
:root[data-theme="dark"] .fm-answer-text { background: #0f1f16; border-color: #24553a; }
:root[data-theme="dark"] .fm-pending-sol { background: #2a1d0c; border-color: #5a3a12; } :root[data-theme="dark"] .fm-pending-sol b { color: #f3b56b; }
:root[data-theme="dark"] .fm-post.is-solution .fm-pa { background: #11261a; }
@media (max-width: 760px) { .fm-post { grid-template-columns: 1fr; } .fm-pa { flex-direction: row; flex-wrap: wrap; text-align: left; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 14px; }
  .fm-pa-av .av, .fm-pa-av .av.photo img { width: 40px; height: 40px; font-size: 1rem; } .fm-thead { padding: 18px 56px 0 18px; } .fm-posts { padding: 14px; } }
#genDialog .fm-view3 { padding: 0; }
.fm-post.fm-first { border-color: #d9d0ff; }
.fm-post.fm-first .fm-pa { background: linear-gradient(180deg, #f4f0ff, var(--card, #fff)); }
.fm-pa-av .av { border-radius: 50%; }
:root[data-theme="dark"] .fm-post.fm-first .fm-pa { background: #17132a; }
.meet-detail .live-hint { margin-left: auto; max-width: 380px; text-align: right; font-size: .74rem; line-height: 1.35; }

/* Tipografía elegida por cada persona (Mi perfil) */
html[data-font] body, html[data-font] button, html[data-font] input, html[data-font] select, html[data-font] textarea { font-family: var(--kx-font); }
.ui-fonts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 2px 0 10px; }
.ui-font { display: grid; gap: 1px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card, #fff); color: var(--text); cursor: pointer; }
.ui-font .ui-aa { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.ui-font b { font-size: .84rem; } .ui-font small { color: var(--muted); font-size: .72rem; }
.ui-font:hover { border-color: #b9a8ff; }
.ui-font.on { border-color: var(--primary, #6a3cf0); box-shadow: 0 0 0 3px rgba(106, 60, 240, .12); }
.ui-sizes { flex-wrap: wrap; }
.ui-preview { margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg-alt); font-size: .9rem; }
@media (max-width: 860px) { .ui-fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Mi perfil: tipografía (lista con texto libre) y tamaño (lista) */
.ui-font-pick { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.ui-font-pick .input { width: 240px; }
.ui-size { width: 260px; flex-shrink: 0; }
.ui-local { margin: -4px 0 6px; font-size: .78rem; }
@media (max-width: 760px) { .ui-font-pick { flex-wrap: wrap; } .ui-font-pick .input, .ui-size { width: 100%; } }
.prof-row > div.ui-font-pick { flex-direction: row; align-items: center; flex-wrap: nowrap; }

/* Mi perfil: lista propia de tipografías */
.ui-combo { position: relative; width: 280px; }
.ui-combo .input { width: 100%; padding-right: 34px; }
.ui-combo .input::selection { background: rgba(106, 60, 240, .18); color: inherit; }
.ui-caret { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .9rem; padding: 4px 6px; transition: transform .15s; }
.ui-combo.open .ui-caret { transform: translateY(-50%) rotate(180deg); }
.ui-dd { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); max-height: 340px; overflow: auto; padding: 6px; border-radius: 12px;
  background: var(--card, #fff); border: 1px solid var(--border); box-shadow: 0 14px 36px rgba(20, 10, 60, .18); }
.ui-dd-h { position: sticky; top: -6px; z-index: 1; background: var(--card, #fff); padding: 8px 10px 4px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ui-dd-h small { font-weight: 500; margin-left: 4px; }
.ui-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-size: .95rem; color: var(--text); cursor: pointer; }
.ui-opt small { margin-left: auto; font-family: Inter, system-ui, sans-serif; font-size: .66rem; color: var(--muted); }
.ui-opt:hover, .ui-opt.act { background: var(--bg-alt); }
.ui-opt.cur { color: var(--primary, #6a3cf0); font-weight: 600; }
.ui-ck { font-family: Inter, sans-serif; }
.ui-opt.cur small { margin-left: 6px; }
.ui-free { border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; }
.ui-dd-empty { margin: 0; padding: 12px; font-size: .82rem; color: var(--muted); }
@media (max-width: 760px) { .ui-combo { width: 100%; } }
/* ===== Integraciones: portada en tarjetas y cada integración en una ventana ===== */
#view-integrations.ih-on > [id$="Panel"], #view-integrations.ih-on > .integ-group, #view-integrations.ih-on .integ-jump { display: none; }
.ih-summary { display: flex; flex-wrap: wrap; gap: 18px; margin: 4px 0 18px; font-size: .86rem; color: var(--muted); }
.ih-summary b { color: var(--text); font-size: 1.05rem; margin-right: 2px; }
.ih-summary .err b { color: #c0262d; }
.ih-group { margin-bottom: 22px; }
.ih-group h4 { margin: 0 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: baseline; gap: 10px; }
.ih-group h4 small { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .8rem; }
.ih-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ih-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: 10px 14px; text-align: left; padding: 16px 18px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--card, #fff); color: var(--text); font: inherit; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.ih-card:hover, .ih-card:focus-visible { border-color: #c9bcff; box-shadow: 0 8px 26px rgba(46, 26, 110, .10); transform: translateY(-1px); outline: none; }
.ih-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: linear-gradient(135deg, #f4f0ff, #fff0f6); border: 1px solid #ece6ff; }
.ih-body { display: grid; gap: 3px; align-content: start; }
.ih-body b { font-size: .95rem; } .ih-body small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.ih-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.ih-st { font-size: .74rem; font-weight: 600; color: var(--muted); background: var(--bg-alt); border-radius: 999px; padding: 3px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.ih-st.ok { color: #1f7a3d; background: #e7f6ec; } .ih-st.err { color: #b42318; background: #fde8e7; } .ih-st.info { color: #4b2bb3; background: #f1edff; }
.ih-st:empty { display: none; }
.ih-go { font-size: .78rem; font-weight: 600; color: var(--primary, #6a3cf0); opacity: 0; transition: opacity .15s; }
.ih-card:hover .ih-go, .ih-card:focus-visible .ih-go { opacity: 1; }
.ih-modal { position: fixed; inset: 0; z-index: 900; background: rgba(20, 14, 45, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 3vh 2vw; animation: ihFade .15s ease; }
.ih-modal[hidden] { display: none; }
.ih-sheet { width: min(1180px, 100%); max-height: 94vh; display: flex; flex-direction: column; background: var(--bg, #f6f5fb); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(20, 10, 60, .35); animation: ihUp .18s ease; }
.ih-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; background: var(--card, #fff); border-bottom: 1px solid var(--border); }
.ih-head > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ih-head h3 { margin: 0; font-size: 1.15rem; } .ih-head small { color: var(--muted); font-size: .82rem; }
.ih-head .ih-st { max-width: 260px; }
.ih-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--card, #fff); cursor: pointer; font-size: 1rem; color: var(--muted); flex-shrink: 0; }
.ih-x:hover { color: var(--text); border-color: #c9bcff; }
.ih-content { overflow: auto; padding: 18px 22px 24px; }
.ih-content > [id$="Panel"] > .panel, .ih-content > .panel { margin: 0; }
.ih-content .panel + .panel { margin-top: 14px; }
body.ih-lock { overflow: hidden; }
@keyframes ihFade { from { opacity: 0; } } @keyframes ihUp { from { transform: translateY(12px); opacity: 0; } }
:root[data-theme="dark"] .ih-ic { background: #1f1a38; border-color: #2c2452; }
:root[data-theme="dark"] .ih-st.ok { background: #173323; color: #7bd69a; } :root[data-theme="dark"] .ih-st.err { background: #3a1513; color: #f59f97; }
@media (max-width: 760px) { .ih-modal { padding: 0; } .ih-sheet { max-height: 100vh; height: 100%; border-radius: 0; } .ih-head .ih-st { display: none; } }
/* dentro de la ventana no se repiten el título ni el estado del primer recuadro (ya están en la cabecera) */
.ih-content > [id$="Panel"] > .panel:first-child > .integ-head > div:first-child,
.ih-content > [id$="Panel"] > .panel:first-child > .integ-head > .pstatus,
.ih-content > [id$="Panel"].panel > .integ-head > div:first-child { display: none; }
.ih-content > [id$="Panel"] > .panel:first-child > .integ-head:not(:has(> :not(div:first-child):not(.pstatus))) { display: none; }
.ih-sheet:focus { outline: none; }
/* ===== Equipo y accesos: pestañas (Usuarios y cuentas · Equipos · Permisos) ===== */
.ph-tabs-wrap { margin-bottom: 16px; }
.ph-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ph-tab { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--card, #fff); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ph-tab > span:last-child { display: grid; gap: 2px; min-width: 0; }
.ph-tab b { font-size: .92rem; } .ph-tab small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.ph-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; background: var(--bg-alt); flex-shrink: 0; }
.ph-tab:hover { border-color: #c9bcff; }
.ph-tab.on { border-color: var(--primary, #6a3cf0); box-shadow: 0 0 0 3px rgba(106, 60, 240, .12); }
.ph-tab.on .ph-ic { background: linear-gradient(135deg, #f4f0ff, #fff0f6); }
:root[data-theme="dark"] .ph-tab.on .ph-ic { background: #1f1a38; }
.hd-warn { flex-basis: 100%; color: #b45309; font-size: .78rem; }

/* Preferencias de la ticketera: correos de la mesa de ayuda */
.hd-mails .hdm-group { margin-top: 12px; }
.hd-mails .hdm-group h5 { margin: 0 0 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hdm-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(160px, 230px) auto; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 6px; cursor: pointer; background: var(--card, #fff); transition: opacity .15s, background .15s; }
.hdm-row:hover { border-color: #c9bcff; }
.hdm-row.off { opacity: .55; background: var(--bg-alt); }
.hdm-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-alt); font-size: 1rem; }
.hdm-main { display: grid; gap: 2px; min-width: 0; }
.hdm-main b { font-size: .88rem; } .hdm-main small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.hdm-main .hdm-note { color: #4b2bb3; }
.hdm-to { display: grid; gap: 1px; font-size: .78rem; line-height: 1.3; }
.hdm-to small { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
@media (max-width: 760px) { .hdm-row { grid-template-columns: 34px 1fr auto; } .hdm-to { grid-column: 2 / 3; } }

/* Preferencias de la ticketera: reglas (escalamiento, acuso, resumen) */
.hd-rules .hd-rule { border: 1px solid var(--border); border-radius: 12px; margin-top: 10px; background: var(--card, #fff); }
.hd-rule-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.hd-rule-head > div { flex: 1; display: grid; gap: 2px; }
.hd-rule-head b { font-size: .9rem; } .hd-rule-head small { color: var(--muted); font-size: .78rem; }
.hd-rule-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-alt); font-size: 1rem; flex-shrink: 0; }
.hd-rule-body { padding: 0 14px 14px 60px; display: grid; gap: 10px; font-size: .84rem; }
.hd-rule-body p { margin: 0; }
.hd-rule.off .hd-rule-body { display: none; }
.hd-num { width: 76px; display: inline-block; margin: 0 4px; padding: 4px 8px; }
.hd-lvl { display: flex; gap: 10px; align-items: flex-start; }
.hd-lvl > div { flex: 1; display: grid; gap: 6px; }
.hd-lvl-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; background: #fde8e7; color: #b42318; flex-shrink: 0; margin-top: 2px; }
.hd-people.sm .hd-person { transform: scale(.94); transform-origin: left center; }
@media (max-width: 760px) { .hd-rule-body { padding-left: 14px; } }

.hd-rule-to { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.hd-to-k { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hd-to-v { font-size: .74rem; background: var(--bg-alt); border-radius: 999px; padding: 2px 10px; color: var(--text); }
.hd-to-v i { color: #b45309; font-style: normal; }

/* Resumen diario: días de envío */
.hd-days-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hd-days { display: inline-flex; gap: 4px; }
.hd-day { position: relative; cursor: pointer; }
.hd-day input { position: absolute; opacity: 0; pointer-events: none; }
.hd-day span { display: inline-grid; place-items: center; min-width: 40px; height: 32px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border);
  font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--card, #fff); transition: all .15s; }
.hd-day input:checked + span { background: var(--primary, #6a3cf0); border-color: var(--primary, #6a3cf0); color: #fff; }
.hd-day input:focus-visible + span { outline: 2px solid #6a3cf0; outline-offset: 2px; }

/* ===== Gestión de Equipo › Horas del equipo ===== */
:root { --th-1: #2a78d6; --th-2: #eb6834; --th-3: #1baf7a; --th-4: #eda100; }
:root[data-theme="dark"] { --th-1: #3987e5; --th-2: #d95926; --th-3: #199e70; --th-4: #c98500; }
.th { position: relative; display: grid; gap: 14px; }
.o-improvement { background: var(--th-1); } .o-project { background: var(--th-2); } .o-freshdesk { background: var(--th-3); } .o-manual { background: var(--th-4); }
.th-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.th-bar .grow { flex: 1; }
.th-dates { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.th-bar .btn-sm { padding: 7px 14px; font-size: .84rem; }
.th-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.th-kpis > div { background: var(--card, #fff); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; display: grid; gap: 2px; }
.th-kpis small { color: var(--muted); font-size: .76rem; } .th-kpis b { font-size: 1.45rem; line-height: 1.2; } .th-kpis span { display: block; color: var(--muted); font-size: .74rem; }
.th-kpis span::first-letter { text-transform: uppercase; }
.th-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.th-card { background: var(--card, #fff); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.th-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.th-card h4 { margin: 0; font-size: .95rem; } .th-card header small { color: var(--muted); font-size: .76rem; }
.th-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--text); }
.th-legend span, .th-split-row > span { display: inline-flex; align-items: center; gap: 6px; }
.th-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; flex-shrink: 0; }
.th-legend .th-sw, .th-split-row .th-sw { margin-right: 0; }
.th-chart { display: grid; gap: 4px; }
.th-axis, .th-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 72px; align-items: center; gap: 12px; }
.th-ticks { position: relative; height: 16px; }
.th-ticks span { position: absolute; transform: translateX(-50%); font-size: .68rem; color: var(--muted); white-space: nowrap; }
.th-ticks span:first-child { transform: none; }
.th-row { padding: 5px 0; border-radius: 8px; cursor: pointer; }
.th-row:hover, .th-row:focus-visible { background: var(--bg-alt); outline: none; }
.th-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .84rem; }
.th-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-track { position: relative; height: 22px; }
.th-grid-l { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--border); opacity: .7; }
.th-bars { position: relative; display: flex; gap: 2px; height: 100%; min-width: 3px; }
.th-seg { height: 100%; min-width: 2px; }
.th-seg:first-child { border-radius: 4px 0 0 4px; } .th-seg:last-child { border-radius: 0 4px 4px 0; } .th-seg:only-child { border-radius: 4px; }
.th-row:hover .th-seg { filter: brightness(1.06); }
.th-total { font-size: .84rem; text-align: right; font-variant-numeric: tabular-nums; }
.th-split { display: grid; gap: 10px; }
.th-split-row { display: grid; grid-template-columns: 1fr auto 40px; gap: 4px 8px; align-items: center; font-size: .84rem; }
.th-split-row small { color: var(--muted); text-align: right; }
.th-split-bar { grid-column: 1 / -1; height: 6px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; }
.th-split-bar span { display: block; height: 100%; border-radius: 999px; }
.th-sub { margin-top: 18px; }
.th-weeks { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 16px; }
.th-week { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.th-wbar { width: 100%; max-width: 26px; background: var(--th-1); border-radius: 4px 4px 0 0; }
.th-wv { font-size: .66rem; color: var(--muted); }
.th-week small { font-size: .6rem; color: var(--muted); white-space: nowrap; }
.th-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.th-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.th-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.th-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.th-prow { cursor: pointer; } .th-prow:hover td { background: var(--bg-alt); }
.th-caret { color: var(--muted); display: inline-block; width: 12px; }
.th-trow td { background: var(--bg-alt); font-size: .8rem; padding: 6px 10px 6px 34px; }
.th-trow[data-th-task] { cursor: pointer; } .th-trow[data-th-task]:hover td { color: var(--primary, #6a3cf0); }
.th-table tfoot td { border-bottom: 0; border-top: 2px solid var(--border); }
.th-tip { position: absolute; z-index: 20; pointer-events: none; min-width: 220px; max-width: 300px; padding: 10px 12px; border-radius: 10px;
  background: var(--card, #fff); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(20, 10, 60, .16); font-size: .8rem; display: grid; gap: 4px; }
.th-tip-total { color: var(--muted); font-size: .76rem; margin-bottom: 4px; }
.th-tip-row, .th-tip-task { display: flex; align-items: center; gap: 6px; } .th-tip-row b, .th-tip-task b { margin-left: auto; padding-left: 10px; }
.th-tip-sub { margin-top: 6px; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.th-tip-task { color: var(--text); font-size: .76rem; }
@media (max-width: 1000px) { .th-grid { grid-template-columns: 1fr; } .th-kpis { grid-template-columns: repeat(2, 1fr); } .th-axis, .th-row { grid-template-columns: 120px 1fr 60px; } }


/* ===== 🎵 Música del equipo (Spotify) ===== */
.sp-fab { position: fixed; right: 22px; bottom: 22px; z-index: 850; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #1db954, #1aa34a); color: #fff; font-size: 1.35rem; box-shadow: 0 10px 26px rgba(16, 100, 50, .35);
  display: grid; place-items: center; transition: transform .15s, box-shadow .15s; }
.sp-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 30px rgba(16, 100, 50, .42); }
.sp-fab.on { box-shadow: 0 0 0 4px rgba(29, 185, 84, .28), 0 10px 26px rgba(16, 100, 50, .35); }
.sp-dock { position: fixed; right: 22px; bottom: 86px; z-index: 850; width: min(380px, calc(100vw - 32px)); border-radius: 16px; overflow: hidden;
  background: var(--card, #fff); border: 1px solid var(--border); box-shadow: 0 22px 60px rgba(20, 10, 60, .28);
  transform: translateY(16px); opacity: 0; pointer-events: none; transition: transform .18s, opacity .18s; }
.sp-dock.open { transform: none; opacity: 1; pointer-events: auto; }
.sp-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 14px; }
.sp-head > div { flex: 1; min-width: 0; display: grid; }
.sp-head b { font-size: .92rem; } .sp-head small { color: var(--muted); font-size: .7rem; line-height: 1.3; }
.sp-logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: #e8f8ee; flex-shrink: 0; }
.sp-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--card, #fff); color: var(--muted); cursor: pointer; font-size: .85rem; }
.sp-btn:hover { color: var(--text); }
.sp-chips { display: flex; gap: 6px; padding: 0 14px 10px; overflow-x: auto; scrollbar-width: thin; }
.sp-chip { flex-shrink: 0; border: 1px solid var(--border); background: var(--card, #fff); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .76rem; cursor: pointer; white-space: nowrap; }
.sp-chip.on { background: #1db954; border-color: #1db954; color: #fff; font-weight: 600; }
.sp-frame { padding: 0 10px 10px; }
.sp-frame iframe { display: block; width: 100%; height: 352px; border: 0; border-radius: 12px; }
.sp-dock.compact .sp-frame iframe { height: 152px; }
.sp-admin .sp-rows { display: grid; gap: 8px; margin: 10px 0; }
.sp-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(220px, 2fr) auto; gap: 8px; align-items: center; }
:root[data-theme="dark"] .sp-logo { background: #143222; }
@media (max-width: 640px) { .sp-fab { right: 14px; bottom: 14px; } .sp-dock { right: 16px; bottom: 76px; } .sp-row { grid-template-columns: 1fr; } }
