/* ===== Tema MingaKo «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: radial-gradient(circle at 50% 40%, #0b3a6e, #04122b) !important; box-shadow: 0 0 0 2px rgba(0, 180, 216, .35), 0 0 14px rgba(0, 180, 216, .35); }
.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 MingaKo (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; }

/* ===== MingaKo 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: 10px; width: 310px; 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: 76px; height: 50px; flex: none; border-radius: 7px; object-fit: cover; background: var(--surface-2, rgba(127,127,127,.12)); }
.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: 260px; } .news-card img, .news-ph { width: 64px; height: 44px; } }

/* 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; } }
