/* Sistema de diseño de la plataforma autoBImation.
   Look azul (23/11): base clara y luminosa, azul de marca, tarjetas que responden al mouse,
   movimiento corto y un asistente con personaje. Modo oscuro opcional por usuario. */

/* Look azul (23/11): base clara y luminosa, azul como color de la marca, modo oscuro opcional por usuario. */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --ink: #0f1b2d;
  --ink-2: #2b3a4f;
  --muted: #64748b;
  --line: #e4e9f1;
  --line-2: #d0d9e5;

  --brand: #2f6bff;        /* acento principal (botones primarios, activos) */
  --brand-ink: #ffffff;
  --brand-soft: #eaf1ff;
  --brand-strong: #1f54d9;
  --blue: #2f6bff;         /* links y acciones */
  --blue-soft: #eaf1ff;
  --yellow: #ffd60a;       /* toque de la marca, muy puntual */
  --yellow-ink: #14213d;
  --violet: #5b5cf0;       /* asistente */
  --violet-soft: #eeeefe;
  --green: #0f9f6e;
  --green-soft: #e3f6ee;
  --pending: #b26a00;
  --pending-soft: #fff4e0;
  --danger: #d92d20;
  --danger-soft: #fdeceb;

  --nav: #0f1f3d;          /* azul profundo para superficies destacadas (métricas, avisos) */
  --nav-ink: #cfdbe7;
  --nav-hover: #1b2d52;
  --side: #e9edf3;         /* menú lateral: gris que contrasta con la pantalla principal */
  --side-ink: #3b4859;
  --side-hover: #dde3ec;
  --side-on: #ffffff;
  --side-on-ink: #1f54d9;

  /* alias que usa el código */
  --accent: var(--brand);
  --accent-ink: var(--brand-ink);
  --accent-soft: var(--brand-soft);

  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .04), 0 2px 6px -2px rgba(15, 27, 45, .06);
  --shadow-hover: 0 2px 4px rgba(15, 27, 45, .04), 0 12px 28px -10px rgba(31, 84, 217, .22);
  --shadow: 0 16px 40px -12px rgba(15, 27, 45, .22);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --font-display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

/* Modo oscuro: solo si el usuario lo elige (Mi perfil o el botón de la barra de arriba). */
:root[data-theme="dark"] {
  --bg: #0e1116; --surface: #161b22; --surface-2: #1c232d; --ink: #e8ecf2; --ink-2: #c4ccd8; --muted: #8b95a5;
  --line: #232b36; --line-2: #313b49;
  --brand: #4c8dff; --brand-ink: #0b1220; --brand-soft: #16264a; --brand-strong: #7aa9ff; --blue: #6ea0ff; --blue-soft: #16264a;
  --violet: #8f90ff; --violet-soft: #23244a; --green: #3ccf8e; --green-soft: #123227; --pending: #f0b45a; --pending-soft: #3a2c14;
  --danger: #ff7a66; --danger-soft: #3d1f1b; --nav: #0a1226; --nav-hover: #16213a;
  --side: #11151b; --side-ink: #9aa4b2; --side-hover: #1a2029; --side-on: #1b2638; --side-on-ink: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35); --shadow-hover: 0 12px 28px -10px rgba(0,0,0,.6); --shadow: 0 16px 40px -12px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink-2); font-family: var(--font-body); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.mini { font-size: 12px; color: var(--muted); }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.error { color: var(--danger); font-size: 13px; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout ---------- */
.app { --navw: 232px; display: grid; grid-template-columns: var(--navw) minmax(0, 1fr) 380px; grid-template-rows: 60px minmax(0, 1fr); height: 100%; }
.app.no-assistant { grid-template-columns: var(--navw) minmax(0, 1fr) 0; }
.app.nav-collapsed { --navw: 64px; }
.app.no-assistant .assistant { display: none; }

.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); background: var(--yellow); color: var(--yellow-ink); box-shadow: 0 1px 0 rgba(0,0,0,.08); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--nav); color: var(--yellow); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 14px; }
.brand b { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--nav); letter-spacing: -.02em; }
.brand b span { color: var(--brand); }
.brand small { font-size: 12px; color: var(--yellow-ink); opacity: .75; font-weight: 600; }
.gsearch { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 8px; padding: 0 12px; height: 38px; box-shadow: 0 1px 2px rgba(0,0,0,.12); color: #627b93; }
.gsearch input { border: 0; outline: 0; flex: 1; background: transparent; color: #213343; min-width: 0; }
.userbox { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar .btn { background: rgba(255,255,255,.7); border-color: transparent; color: var(--nav); }
.topbar .btn:hover { background: #fff; }
.userbtn { gap: 8px; padding: 3px 12px 3px 4px !important; border-radius: 99px !important; }
.role { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: rgba(33,51,67,.1); color: var(--nav); }
.role.admin { background: var(--nav); color: var(--yellow); }

.nav { background: var(--nav); color: var(--nav-ink); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; color: var(--nav-ink); font-weight: 500; position: relative; }
.nav button:hover { background: var(--nav-hover); color: #fff; }
.nav button.on { background: var(--nav-hover); color: #fff; font-weight: 600; }
.nav button.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.nav button .badge { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--brand); color: #fff; }
.nav .sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 6px; }
.nav .phase { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #8ea3b8; padding: 8px 12px 4px; font-weight: 700; }

.main { overflow-y: auto; padding: 24px max(20px, env(safe-area-inset-right, 0px)) 48px max(20px, env(safe-area-inset-left, 0px)); min-width: 0; }
.main-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head h1 { font-size: 26px; font-weight: 800; }
.head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 2px; font-weight: 600; }

/* ---------- Botones ---------- */
.btn { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); padding: 8px 16px; border-radius: 8px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 2px 6px rgba(255,92,53,.28); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--blue); }
.btn.warn { background: var(--pending); border-color: var(--pending); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
select.btn { padding-right: 28px; }

/* ---------- Tarjetas y KPIs ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 17px; margin-bottom: 6px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--kpi-color, var(--blue)); }
.kpi .n { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi:nth-child(2) { --kpi-color: var(--brand); }
.kpi:nth-child(3) { --kpi-color: var(--green); }
.kpi:nth-child(4) { --kpi-color: var(--violet); }
.report { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.notice, .warnbox { border: 1px solid #f5c26b; background: var(--pending-soft); border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--ink-2); }
.lockbox { text-align: center; padding: 40px 20px; }
.lockbox .big { font-size: 40px; }

/* ---------- Filtros ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { flex: 1 1 240px; min-width: 0; border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 9px 12px; }
.search:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px var(--blue-soft); }
.selects { display: flex; gap: 8px; flex-wrap: wrap; }
.selects select { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 8px 10px; max-width: 190px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); padding: 6px 13px; border-radius: 99px; font-size: 13px; font-weight: 600; display: inline-flex; gap: 7px; align-items: center; color: var(--ink-2); }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip .c { font-family: var(--font-mono); font-size: 11px; background: rgba(0,0,0,.06); padding: 0 6px; border-radius: 99px; }
.chip.on .c { background: rgba(255,255,255,.22); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Tablas ---------- */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--blue-soft); }
td b { color: var(--ink); }
td .sub { font-size: 12px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--pill-bg, var(--surface-2)); color: var(--ink); white-space: nowrap; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.morebar { display: flex; justify-content: center; padding: 10px; }

/* ---------- Estados (configuración) ---------- */
.states-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.state-row { display: grid; grid-template-columns: 28px 46px minmax(0, 1fr) 40px 120px 120px auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.state-row input[type=text] { width: 100%; border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; background: var(--surface); }
.state-row input[type=color] { width: 38px; height: 30px; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px; background: var(--surface); }
.state-row .ord { font-family: var(--font-mono); color: var(--muted); text-align: center; }
.state-row .count { font-size: 12px; color: var(--muted); text-align: right; }
.iconbtns { display: flex; gap: 4px; }
.iconbtn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 6px; width: 30px; height: 30px; display: grid; place-items: center; font-size: 13px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* ---------- Listas, historial ---------- */
.log { display: flex; flex-direction: column; }
.log-item { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.log-item:last-child { border-bottom: 0; }
.via { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); align-self: start; }
.via.asistente { background: var(--violet-soft); color: var(--violet); }
.placeholder { display: grid; gap: 10px; }
.placeholder ul { margin: 0; padding-left: 18px; color: var(--muted); }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline > div { font-size: 13px; border-left: 3px solid var(--line-2); padding: 2px 0 2px 12px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; display: flex; gap: 10px; align-items: flex-start; background: var(--surface); }
.item .grow { flex: 1; min-width: 0; }
.item .sub { font-size: 12px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.state-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 10px; background: var(--surface-2); }

/* ---------- Formularios ---------- */
fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
fieldset legend { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin-bottom: 8px; padding: 0; color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 8px 11px; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px var(--blue-soft); }
.field textarea { min-height: 72px; resize: vertical; }
.req { color: var(--danger); }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px; background: var(--surface-2); }
.inline-form .field.full { grid-column: 1 / -1; }

/* ---------- Ficha (drawer) y modales ---------- */
.scrim, .modal-bg { position: fixed; inset: 0; background: rgba(15, 25, 35, .45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--surface); z-index: 41; box-shadow: var(--shadow); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.drawer-head h2 { font-size: 20px; font-weight: 800; }
.drawer-body { overflow-y: auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 18px; }
.modal-bg { z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; padding: 20px; width: min(460px, 100%); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.modal h2 { font-size: 18px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 9px 12px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 220px; max-height: calc(100vh - 210px); border-top: 4px solid var(--col, var(--line-2)); }
.kcol.over { outline: 2px dashed var(--blue); }
.kcol header { padding: 11px 13px; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.kcol header .c { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); background: var(--surface); padding: 1px 8px; border-radius: 99px; }
.kcards { padding: 0 9px 9px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; font-size: 13px; box-shadow: var(--shadow-sm); }
.kcard:hover { border-color: var(--blue); }
.kcard b { color: var(--ink); }
.kcard .sub { font-size: 12px; color: var(--muted); }
.kmore { font-size: 12px; color: var(--muted); padding: 4px 12px 12px; }

/* ---------- Asistente ---------- */
.assistant { border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.as-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; background: linear-gradient(135deg, var(--violet-soft), var(--surface)); }
.as-head h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.as-head h2 i { width: 26px; height: 26px; border-radius: 8px; background: var(--violet); display: inline-grid; place-items: center; color: #fff; font-style: normal; font-size: 13px; }
.as-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; }
.msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; color: var(--ink-2); }
.msg.bot p { margin: 0 0 6px; } .msg.bot p:last-child { margin: 0; }
.preview { align-self: stretch; border: 1.5px solid #f5c26b; background: var(--pending-soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.preview.done { border-color: var(--green); background: var(--green-soft); }
.preview.cancel { border-color: var(--line); background: var(--surface-2); opacity: .8; }
.preview h3 { font-size: 13px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.preview h3 span { font-family: var(--font-body); font-size: 11px; font-weight: 700; color: var(--pending); text-transform: uppercase; letter-spacing: .06em; }
.preview.done h3 span { color: var(--green); }
.pv-table { width: 100%; border-collapse: collapse; min-width: 0; font-size: 12.5px; }
.pv-table td { padding: 4px 6px; border-bottom: 1px solid rgba(0,0,0,.06); vertical-align: top; cursor: default; }
.pv-table td:first-child { color: var(--muted); width: 96px; }
.pv-table .old { text-decoration: line-through; color: var(--muted); }
.pv-table tr:hover td { background: transparent; }
.pv-grid { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 5px 8px; align-items: center; font-size: 13px; }
.pv-grid label { color: var(--muted); font-size: 12px; }
.pv-grid input { border: 1px solid var(--line-2); background: var(--surface); border-radius: 6px; padding: 4px 7px; width: 100%; font-size: 13px; }
.pv-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.warnline { font-size: 12px; color: var(--danger); }
.typing { color: var(--muted); font-size: 13px; font-style: italic; }
.as-suggest { padding: 0 14px 8px; display: flex; gap: 6px; overflow-x: auto; }
.as-suggest button { flex: none; border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 5px 11px; font-size: 12px; white-space: nowrap; color: var(--ink-2); }
.as-suggest button:hover { border-color: var(--violet); color: var(--violet); }
.as-input { display: flex; gap: 8px; padding: 10px 14px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.as-input textarea { flex: 1; resize: none; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 9px 11px; min-height: 42px; max-height: 120px; }
.as-input .btn.primary { background: var(--violet); border-color: var(--violet); box-shadow: none; }
.as-toggle { display: none; }

/* ---------- Varios ---------- */
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--nav); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; font-size: 13px; box-shadow: var(--shadow); }
.avatar { border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; flex: none; }
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, var(--yellow) 0 34%, var(--bg) 34%); }
.login-card { width: min(410px, 100%); background: var(--surface); border-radius: 16px; padding: 30px 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 26px; font-weight: 800; }
.login-card h1 span { color: var(--brand); }
.login-card .field input { padding: 11px 12px; }
.login-card .btn { justify-content: center; padding: 11px 14px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--blue-soft); color: var(--blue); }
.tag.orange { background: var(--brand-soft); color: var(--brand); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.violet { background: var(--violet-soft); color: var(--violet); }
.tag.gray { background: var(--surface-2); color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .app { --navw: 210px; }
  .app.nav-collapsed { --navw: 64px; }
  .app, .app.no-assistant { grid-template-columns: var(--navw) minmax(0, 1fr); }
  .assistant { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 45; box-shadow: var(--shadow); padding-top: env(safe-area-inset-top, 0px); }
  .app.no-assistant .assistant { display: none; }
  .as-toggle { display: inline-flex; }
  .gsearch { display: none; }
}
@media (max-width: 720px) {
  .app, .app.no-assistant { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .topbar { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .brand { min-width: 0; }
  .brand small, .userbtn span:not(.avatar) { display: none; }
  .nav { flex-direction: row; overflow-x: auto; padding: 8px 12px; }
  .nav button { width: auto; flex: none; }
  .nav button.on::before { display: none; }
  .nav .sep, .nav .phase { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  fieldset { grid-template-columns: minmax(0, 1fr); }
  .state-row { grid-template-columns: 28px 46px minmax(0, 1fr) 40px; }
  .state-row .check, .state-row .iconbtns { grid-column: span 2; }
  .log-item { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Fases 2 a 4: inicio, hitos, presentación, producto, finanzas, conectores ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 24px; border-radius: 16px; background: linear-gradient(120deg, var(--surface) 0%, var(--surface) 55%, var(--brand-soft) 100%); border: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: var(--yellow); opacity: .35; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 28px; font-weight: 800; }
.hero p { margin: 4px 0 0; color: var(--muted); max-width: 72ch; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.barrow { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.barrow .bl { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barrow .bv { font-size: 12px; color: var(--ink); min-width: 32px; text-align: right; }
.barrow[data-fs]:hover .bl { color: var(--blue); }
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: stretch; }
.metric { background: var(--nav); color: #e8eef4; border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); }
.metric .label { color: #9fb3c8; }
.metric b { font-family: var(--font-display); font-size: 22px; color: var(--yellow); font-weight: 800; }
.metric .mini { color: #b8c7d6; }
.metric-edit { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 6px; }
.metric-edit input { border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; background: var(--surface); min-width: 0; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.mcard { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--blue)); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm); }
.mcard.hl { background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.mcard h3 { font-size: 15.5px; font-weight: 800; }
.mcard p { margin: 0; font-size: 13px; color: var(--ink-2); }
.mtop { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mdate { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--c, var(--blue)); }
.mfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.weekly .wk p { margin: 2px 0 8px; font-size: 13px; white-space: pre-wrap; }
.weekly { display: flex; flex-direction: column; gap: 10px; }
.conn { display: flex; flex-direction: column; gap: 10px; }
.conn h2 { margin: 0; }
code { font-family: var(--font-mono); font-size: 11.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.fc table { min-width: 1250px; font-size: 12.5px; }
.fc td, .fc th { padding: 6px 8px; }
.fc td:first-child, .fc th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 190px; }
.fc th:first-child { background: var(--surface-2); z-index: 2; }
.num { text-align: right; }
.cell { width: 92px; border: 1px solid transparent; background: transparent; border-radius: 5px; padding: 4px 6px; text-align: right; font-size: 12px; }
.cell:hover { border-color: var(--line-2); }
.cell:focus { border-color: var(--blue); background: var(--surface); outline: 0; }
.fc tbody tr { cursor: default; }
.fc tbody tr:hover td { background: inherit; }
.fc-total td { background: var(--surface-2) !important; font-weight: 600; }
.fc-total.res td { background: var(--blue-soft) !important; }
.fc-calculado td { color: var(--muted); }

/* Presentación imprimible */
.pres { max-width: 980px; margin: 0 auto; padding: 20px 16px 60px; display: flex; flex-direction: column; gap: 26px; }
.pres-bar { display: flex; justify-content: space-between; gap: 10px; position: sticky; top: 0; padding: 10px 0; background: var(--bg); z-index: 2; }
.pres-cover { background: var(--yellow); color: var(--nav); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.pres-cover h1 { font-size: 34px; font-weight: 800; color: var(--nav); }
.pres-cover p { margin: 0; font-weight: 500; }
.pres-cover small { color: var(--yellow-ink); font-weight: 600; }
.pres-sec { display: flex; flex-direction: column; gap: 12px; break-inside: avoid; }
.pres-sec h2 { font-size: 20px; font-weight: 800; padding-bottom: 6px; border-bottom: 3px solid var(--brand); align-self: flex-start; }
.ptimeline { display: flex; flex-direction: column; border-left: 3px solid var(--line-2); margin-left: 6px; }
.pt-item { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; padding: 10px 0 14px 18px; position: relative; break-inside: avoid; }
.pt-item::before { content: ""; position: absolute; left: -8px; top: 14px; width: 13px; height: 13px; border-radius: 50%; background: var(--c); border: 2px solid var(--bg); }
.pt-date { font-size: 12px; font-weight: 800; color: var(--c); text-transform: uppercase; letter-spacing: .03em; }
.pt-item p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.pres-foot { text-align: center; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
@media print {
  :root { --bg: #fff; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print { display: none !important; }
  .pres { padding: 0; gap: 18px; }
  .panel, .kpi, .mcard { box-shadow: none; }
  @page { margin: 14mm; }
}
@media (max-width: 720px) {
  .barrow { grid-template-columns: minmax(80px, 110px) minmax(0, 1fr) auto; }
  .pt-item { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .hero { padding: 18px; }
  .hero h1 { font-size: 23px; }
  .metric-edit { grid-template-columns: 1fr; }
}

.item .tag { flex: none; align-self: flex-start; }
.kanban { grid-auto-columns: minmax(220px, 1fr); }

/* ---------- Ajustes nov-2026: menú contraíble, etiquetas, personas, reuniones, conversaciones ---------- */
.navtoggle { background: rgba(255,255,255,.55) !important; border-color: transparent !important; color: var(--nav) !important; flex: none; }
.navtoggle:hover { background: #fff !important; }
.app.nav-collapsed .nav { padding: 14px 8px; }
.app.nav-collapsed .nav button { justify-content: center; padding: 10px 0; }
.app.nav-collapsed .nav button span, .app.nav-collapsed .nav .phase { display: none; }
.app.nav-collapsed .nav .phase + button { margin-top: 10px; }
.app.nav-collapsed .nav button.on::before { left: -8px; }
.nav { transition: padding .15s; }
.tagpill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); white-space: nowrap; flex: none; }
.tagpill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.task-title { cursor: pointer; }
.task-title:hover { color: var(--blue); }
.whosel { min-width: 170px; }
.panel-head .whosel { font-size: 12.5px; padding: 4px 8px; }
.cat-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cat-row.nocolor { grid-template-columns: minmax(0, 1fr) auto auto; }
.cat-row.off { opacity: .55; }
.cat-row input[type=color] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: none; }
.cat-row input[data-cname] { border: 1px solid transparent; background: none; font-weight: 600; padding: 6px 8px; border-radius: 6px; }
.cat-row input[data-cname]:hover, .cat-row input[data-cname]:focus { border-color: var(--line-2); background: var(--surface); }
.cat-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.cat-add { display: flex; gap: 8px; align-items: center; }
.cat-add input[name=name] { flex: 1; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 12px; }
.person { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; position: relative; }
.person.primary { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.person .ph { display: flex; gap: 10px; align-items: center; }
.person .ph b { display: block; }
.person .links { display: flex; gap: 6px; flex-wrap: wrap; }
.person .edit { position: absolute; top: 10px; right: 10px; }
.cbtn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); text-decoration: none; }
.cbtn:hover { border-color: var(--blue); color: var(--blue); }
button.cbtn { cursor: pointer; font-family: inherit; line-height: inherit; }
.cbtn.wa { border-color: #25d366; color: #128c4a; background: #e9fbf0; }
.cbtn.wa:hover { background: #d6f7e3; }
.contact-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.insight { border-radius: 14px; padding: 16px 18px; background: linear-gradient(135deg, var(--nav) 0%, #2d4b66 100%); color: #e9f1f8; display: flex; flex-direction: column; gap: 10px; }
.insight h3 { margin: 0; font-family: var(--font-display); font-size: 16px; color: #fff; }
.insight .badge { align-self: flex-start; background: var(--yellow); color: var(--nav); font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 99px; }
.insight .kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 16px; font-size: 13px; }
.insight .kv span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #9fb4c8; font-weight: 700; }
.insight .opp { background: rgba(255,255,255,.08); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.meetings { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.meet { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); }
.meet .when { text-align: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); padding: 8px 0; align-self: start; }
.meet .when b { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1; }
.meet .when small { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.meet h4 { margin: 0 0 4px; font-size: 14.5px; }
.meet .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.meet details { margin-top: 8px; }
.meet summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--blue); }
.meet ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.rec { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; color: #fff; background: var(--violet); padding: 4px 11px; border-radius: 99px; text-decoration: none; }
.rec:hover { filter: brightness(1.1); }
.month-h { font-family: var(--font-display); font-size: 15px; margin: 18px 0 0; color: var(--ink-2); }
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; padding: 14px; border-radius: 12px; background: var(--surface-2); margin-top: 12px; }
.bubble { max-width: 78%; padding: 8px 11px; border-radius: 12px; font-size: 13.5px; background: var(--surface); box-shadow: var(--shadow-sm); word-break: break-word; }
.bubble .bx { white-space: pre-wrap; }
.bubble.out { align-self: flex-end; background: #dcf8c6; color: #1d2a1f; }
.bubble.email { border-left: 3px solid var(--blue); }
.bubble.out.email { background: var(--blue-soft); color: var(--ink); }
.bubble .bm { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.bubble .bt { display: block; font-size: 10.5px; color: var(--muted); text-align: right; margin-top: 3px; }
.chat .day { align-self: center; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface); padding: 2px 10px; border-radius: 99px; margin: 6px 0; }
.compose { display: grid; gap: 8px; margin-top: 12px; }
.compose textarea { min-height: 70px; }
.fc td.real input, .fc td.real { background: var(--green-soft); }
.fc td.real .mono { color: var(--green); font-weight: 700; }
.fc tr.auto td:first-child b { color: var(--green); }
.files { display: flex; flex-direction: column; gap: 6px; }
.files .f { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.clip { display: inline-flex; align-items: center; gap: 3px; color: var(--blue); font-weight: 700; font-size: 12px; }
.kind-in { color: var(--green); font-weight: 700; }
.kind-out { color: var(--danger); font-weight: 700; }
.gmailbox { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 720px) {
  .navtoggle { display: none !important; }
  .app.nav-collapsed .nav button span { display: inline; }
  .meet { grid-template-columns: minmax(0, 1fr); }
  .meet .when { display: flex; gap: 6px; justify-content: center; align-items: baseline; }
  .bubble { max-width: 92%; }
}
.compose-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.compose select, .compose input, .compose textarea { width: 100%; min-width: 0; }
.modal .item input[name^="bk"] { width: 100%; }
/* Tarjeta de Trello editable */
.tc-title { width: 100%; font-size: 20px; font-weight: 800; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; background: transparent; color: var(--ink); }
.tc-title:hover, .tc-title:focus { border-color: var(--line-2); background: var(--surface); }
.tc-inline { border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; font: inherit; background: var(--surface); color: var(--ink); }
.tc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
@media (max-width: 760px) { .tc-grid { grid-template-columns: 1fr; } }
.tc-check { margin: 8px 0; }
.tc-item { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; font-size: 13.5px; cursor: pointer; }
.tc-add { display: flex; gap: 6px; margin: 6px 0; align-items: flex-start; }
.tc-add input, .tc-add textarea { flex: 1; }
.tc-comment { border-left: 3px solid var(--line-2); padding: 4px 10px; margin: 8px 0; font-size: 13.5px; }
.tc-addcard { width: 100%; justify-content: center; opacity: .75; margin-top: 4px; }
.tc-addcard:hover { opacity: 1; }

/* Redactar email (estilo Gmail) */
.cm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cm-head .btn { margin-left: auto; }
.cm-row { position: relative; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.cm-row[hidden] { display: none; }
.cm-row > label { width: 42px; color: var(--muted); font-size: 13px; }
.cm-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; cursor: text; min-height: 30px; }
.cm-chips input { flex: 1; min-width: 160px; border: 0; outline: 0; background: transparent; padding: 4px 0; font: inherit; color: var(--ink); }
.cm-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 99px; padding: 2px 4px 2px 10px; font-size: 13px; }
.cm-chip button, .cm-file button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 12px; }
.cm-toggles a { font-size: 13px; color: var(--muted); margin-left: 6px; }
.cm-sug { position: absolute; left: 50px; right: 0; top: 100%; z-index: 30; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); max-height: 280px; overflow: auto; }
.cm-opt { padding: 7px 12px; cursor: pointer; font-size: 13.5px; }
.cm-opt span { color: var(--muted); }
.cm-opt.on, .cm-opt:hover { background: var(--surface-2); }
.cm-subject { flex: 1; border: 0; outline: 0; background: transparent; padding: 6px 0; font: inherit; font-weight: 600; color: var(--ink); }
.cm-body { width: 100%; border: 0; outline: 0; resize: vertical; padding: 10px 0; font: inherit; background: transparent; color: var(--ink); min-height: 240px; }
.cm-files { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-file { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 8px; font-size: 13px; background: var(--surface-2); }
.cm-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

/* ===== Modal: nunca más alto que la pantalla ===== */
.modal { max-height: calc(100vh - 32px); overflow: auto; position: relative; }

/* ===== Trello ===== */
.tr-wrap { margin: -8px -4px 0; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, #0c66e4 0%, #5e4db2 100%); min-height: calc(100vh - 120px); display: flex; flex-direction: column; }
.tr-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(0,0,0,.24); color: #fff; flex-wrap: wrap; }
.tr-boardsel { font: inherit; font-weight: 800; font-size: 17px; color: #fff; background: rgba(255,255,255,.14); border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.tr-boardsel option { color: #172b4d; }
.tr-barbtn { font: inherit; font-size: 13.5px; color: #fff; background: rgba(255,255,255,.18); border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer; text-decoration: none; }
.tr-barbtn:hover, .tr-barbtn.on { background: rgba(255,255,255,.34); }
.tr-search { margin-left: auto; font: inherit; font-size: 13.5px; border: 0; border-radius: 6px; padding: 7px 10px; width: 220px; background: rgba(255,255,255,.9); color: #172b4d; }
.tr-last { font-size: 12px; opacity: .85; }
.tr-note { margin: 10px 14px 0; background: #fff7d6; color: #172b4d; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.tr-modal .tr-note { margin: 0 0 10px; }
.tr-canvas { flex: 1; overflow-x: auto; padding: 12px; }
.tr-lists { display: flex; align-items: flex-start; gap: 12px; min-height: 100%; }
.tr-list { flex: 0 0 272px; background: #f1f2f4; border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 210px); box-shadow: 0 1px 1px rgba(9,30,66,.25); }
.tr-list header { display: flex; align-items: center; padding: 10px 12px 6px; color: #172b4d; font-size: 14px; }
.tr-list header span { margin-left: auto; font-size: 12px; color: #626f86; }
.tr-cards { padding: 2px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 8px; border-radius: 8px; }
.tr-cards.over { background: rgba(9,30,66,.06); }
.tr-card { background: #fff; border-radius: 8px; padding: 8px 10px; box-shadow: 0 1px 1px rgba(9,30,66,.25), 0 0 1px rgba(9,30,66,.31); cursor: pointer; color: #172b4d; font-size: 14px; }
.tr-card:hover { outline: 2px solid #388bff; }
.tr-card.dragging { opacity: .5; transform: rotate(2deg); }
.tr-card-title { line-height: 1.35; word-break: break-word; }
.tr-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tr-label { display: inline-block; min-width: 40px; height: 16px; line-height: 16px; border-radius: 4px; padding: 0 8px; font-size: 12px; font-weight: 600; color: #172b4d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tr-label.big { height: 32px; line-height: 32px; font-size: 14px; padding: 0 12px; }
.tr-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: 12px; color: #44546f; }
.tr-badge { display: inline-flex; align-items: center; gap: 3px; border-radius: 4px; padding: 1px 4px; color: inherit; text-decoration: none; }
.tr-badge.due.late { background: #c9372c; color: #fff; }
.tr-badge.due.soon { background: #f5cd47; color: #172b4d; }
.tr-badge.due.done, .tr-badge.okb { background: #1f845a; color: #fff; }
.tr-badge.acc:hover { text-decoration: underline; }
.tr-members { margin-left: auto; display: flex; gap: 2px; }
.tr-av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; flex: 0 0 auto; }
.tr-compose { padding: 6px 8px 8px; }
.tr-addbtn { width: 100%; text-align: left; font: inherit; font-size: 14px; color: #44546f; background: transparent; border: 0; border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.tr-addbtn:hover { background: rgba(9,30,66,.1); color: #172b4d; }
.tr-newcard { width: 100%; border: 0; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; box-shadow: 0 1px 1px rgba(9,30,66,.25); resize: none; margin-bottom: 6px; }
.tr-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 10px; }
.tr-empty { color: #fff; padding: 30px; text-align: center; }
/* Tarjeta abierta */
.modal.tr-modal { width: min(780px, 100%); background: #f1f2f4; color: #172b4d; padding: 20px 20px 24px; gap: 8px; }
.tr-x { position: sticky; top: 0; margin: -6px -6px 0 auto; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(9,30,66,.08); font-size: 16px; cursor: pointer; color: #44546f; flex: 0 0 auto; align-self: flex-end; }
.tr-x:hover { background: rgba(9,30,66,.18); }
.tr-mhead { display: flex; gap: 10px; margin-top: -30px; padding-right: 40px; }
.tr-ico { width: 24px; flex: 0 0 24px; color: #44546f; font-weight: 700; display: inline-block; text-align: center; }
.tr-title { width: 100%; font: inherit; font-size: 20px; font-weight: 700; color: #172b4d; border: 0; border-radius: 6px; background: transparent; padding: 2px 6px; resize: none; overflow: hidden; }
.tr-title:focus { background: #fff; box-shadow: inset 0 0 0 2px #388bff; outline: 0; }
.tr-inline { font: inherit; font-size: 13px; border: 0; background: transparent; text-decoration: underline; color: #44546f; cursor: pointer; }
.tr-mgrid { display: grid; grid-template-columns: minmax(0, 1fr) 168px; gap: 16px; }
@media (max-width: 700px) { .tr-mgrid { grid-template-columns: 1fr; } }
.tr-meta { display: flex; flex-wrap: wrap; gap: 14px 22px; padding-left: 34px; }
.tr-meta h4, .tr-side h4 { margin: 0 0 6px; font-size: 12px; color: #44546f; font-weight: 600; }
.tr-plus { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(9,30,66,.08); cursor: pointer; font-size: 18px; color: #44546f; }
.tr-due { display: inline-flex; align-items: center; gap: 6px; background: rgba(9,30,66,.06); border-radius: 4px; padding: 6px 10px; font-size: 14px; cursor: pointer; }
.tr-due b { font-size: 12px; padding: 1px 6px; border-radius: 3px; }
.tr-due.late b { background: #c9372c; color: #fff; } .tr-due.soon b { background: #f5cd47; } .tr-due.done b { background: #1f845a; color: #fff; }
.tr-chipbtn { display: inline-block; background: rgba(9,30,66,.06); border-radius: 4px; padding: 6px 10px; color: #172b4d; text-decoration: none; font-size: 14px; }
.tr-sec { margin-top: 18px; }
.tr-sec h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 16px; }
.tr-sec h3 .btn { margin-left: auto; }
.tr-desc, .tr-desc-view, .tr-additem, .tr-comment-new textarea { margin-left: 34px; width: calc(100% - 34px); }
.tr-desc { font: inherit; font-size: 14px; border: 0; border-radius: 6px; padding: 8px 10px; box-shadow: inset 0 0 0 2px #388bff; background: #fff; }
.tr-desc-view { white-space: pre-wrap; font-size: 14px; line-height: 1.5; cursor: pointer; padding: 4px 0; }
.tr-sec > .tr-row { margin: 6px 0 0 34px; }
.tr-prog { display: flex; align-items: center; gap: 10px; margin-left: 0; font-size: 11px; color: #44546f; }
.tr-prog span { width: 24px; text-align: center; }
.tr-prog div { flex: 1; height: 8px; background: rgba(9,30,66,.1); border-radius: 4px; overflow: hidden; }
.tr-prog i { display: block; height: 100%; background: #579dff; border-radius: 4px; }
.tr-item { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0 6px 4px; font-size: 14px; cursor: pointer; border-radius: 6px; }
.tr-item:hover { background: rgba(9,30,66,.06); }
.tr-item input { width: 16px; height: 16px; margin-top: 2px; }
.tr-item .done { text-decoration: line-through; color: #626f86; }
.tr-additem { font: inherit; font-size: 14px; border: 0; background: rgba(9,30,66,.06); border-radius: 6px; padding: 7px 10px; margin-top: 4px; }
.tr-att { display: flex; gap: 12px; align-items: center; margin: 0 0 8px 34px; text-decoration: none; color: #172b4d; font-size: 14px; }
.tr-att > span { width: 80px; height: 56px; border-radius: 4px; background: rgba(9,30,66,.08); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #44546f; }
.tr-comment-new, .tr-comment { display: flex; gap: 10px; margin: 10px 0; align-items: flex-start; }
.tr-comment-new textarea { margin-left: 0; width: 100%; font: inherit; font-size: 14px; border: 0; border-radius: 8px; padding: 8px 10px; box-shadow: 0 1px 1px rgba(9,30,66,.25); margin-bottom: 6px; }
.tr-bubble { background: #fff; border-radius: 8px; padding: 8px 12px; margin-top: 4px; white-space: pre-wrap; font-size: 14px; box-shadow: 0 1px 1px rgba(9,30,66,.25); }
.tr-side { display: flex; flex-direction: column; gap: 6px; position: relative; }
.tr-side h4 { margin-top: 8px; }
.tr-sbtn { display: flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; text-align: left; background: rgba(9,30,66,.06); color: #172b4d; border: 0; border-radius: 4px; padding: 7px 10px; cursor: pointer; text-decoration: none; }
.tr-sbtn:hover { background: rgba(9,30,66,.13); }
.tr-pop { background: #fff; border-radius: 8px; box-shadow: 0 8px 12px rgba(9,30,66,.15), 0 0 1px rgba(9,30,66,.31); padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.tr-pop[hidden] { display: none; }
.tr-pop input, .tr-pop select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid #8590a2; border-radius: 4px; width: 100%; }
.tr-popopt { display: flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; background: transparent; border: 0; border-radius: 4px; padding: 4px; cursor: pointer; text-align: left; color: #172b4d; }
.tr-popopt:hover { background: rgba(9,30,66,.06); }

/* ===== WhatsApp ===== */
.wa-wrap { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100vh - 110px); border-radius: 12px; overflow: hidden; border: 1px solid #d1d7db; background: #fff; }
@media (max-width: 800px) { .wa-wrap { grid-template-columns: 1fr; height: auto; } .wa-main { min-height: 70vh; } }
.wa-side { display: flex; flex-direction: column; border-right: 1px solid #d1d7db; min-height: 0; background: #fff; }
.wa-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f0f2f5; color: #111b21; }
.wa-ib { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; font-size: 17px; color: #54656f; }
.wa-ib:hover { background: rgba(0,0,0,.06); }
.wa-searchbox { padding: 8px 12px; }
.wa-searchbox input { width: 100%; border: 0; border-radius: 8px; background: #f0f2f5; padding: 8px 14px; font: inherit; font-size: 14px; }
.wa-status { font-size: 12px; color: #667781; padding: 0 16px 8px; }
.wa-list { overflow-y: auto; flex: 1; }
.wa-chat { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: #fff; padding: 10px 14px; cursor: pointer; text-align: left; font: inherit; }
.wa-chat:hover { background: #f5f6f6; } .wa-chat.on { background: #f0f2f5; }
.wa-cmain { flex: 1; min-width: 0; border-bottom: 1px solid #e9edef; padding-bottom: 10px; }
.wa-crow { display: flex; gap: 8px; } .wa-crow b { flex: 1; font-weight: 500; color: #111b21; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-when { font-size: 12px; color: #667781; }
.wa-last { display: block; font-size: 14px; color: #667781; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-none { padding: 24px; color: #667781; font-size: 14px; text-align: center; }
.wa-main { display: flex; flex-direction: column; min-height: 0; background: #efeae2; }
.wa-hello { margin: auto; text-align: center; max-width: 460px; color: #41525d; padding: 30px; }
.wa-hello-ico { font-size: 56px; } .wa-hello h2 { font-weight: 300; font-size: 28px; margin: 10px 0; }
.wa-loading { margin: auto; color: #667781; }
.wa-chead { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: #f0f2f5; color: #111b21; }
.wa-to { font: inherit; font-size: 12.5px; border: 0; background: transparent; color: #667781; max-width: 100%; }
.wa-msgs { flex: 1; overflow-y: auto; padding: 16px 7%; display: flex; flex-direction: column; gap: 3px; background-color: #efeae2; background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 18px 18px; }
.wa-day { text-align: center; margin: 10px 0; } .wa-day span { background: #fff; color: #54656f; font-size: 12.5px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-b { max-width: 65%; padding: 6px 8px 8px 9px; border-radius: 8px; font-size: 14.2px; color: #111b21; box-shadow: 0 1px .5px rgba(11,20,26,.13); display: flex; flex-direction: column; position: relative; }
.wa-b.in { align-self: flex-start; background: #fff; border-top-left-radius: 0; }
.wa-b.out { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 0; }
.wa-b b { font-size: 12.8px; font-weight: 600; }
.wa-bt { white-space: pre-wrap; word-break: break-word; padding-right: 48px; }
.wa-bm { align-self: flex-end; font-size: 11px; color: #667781; margin-top: -12px; }
.wa-b.out .wa-bm { color: #53bdeb; }
.wa-foot { display: flex; align-items: flex-end; gap: 8px; padding: 8px 14px; background: #f0f2f5; }
.wa-foot textarea { flex: 1; border: 0; border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 15px; resize: none; max-height: 140px; }
.wa-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: #00a884; color: #fff; font-size: 18px; cursor: pointer; }
.wa-send:disabled { background: #b5bfc4; cursor: default; }

/* ===== Discord ===== */
.dc-wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: calc(100vh - 110px); border-radius: 12px; overflow: hidden; background: #313338; color: #dbdee1; }
@media (max-width: 800px) { .dc-wrap { grid-template-columns: 1fr; height: auto; } .dc-main { min-height: 70vh; } }
.dc-side { background: #2b2d31; display: flex; flex-direction: column; min-height: 0; }
.dc-server { padding: 14px 16px; font-weight: 700; color: #f2f3f5; border-bottom: 1px solid #1f2023; display: flex; align-items: center; gap: 8px; }
.dc-dot { width: 9px; height: 9px; border-radius: 50%; background: #80848e; margin-left: auto; } .dc-dot.on { background: #23a55a; }
.dc-cat { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #949ba4; padding: 16px 16px 4px; letter-spacing: .02em; }
.dc-ch { display: block; width: calc(100% - 16px); margin: 1px 8px; text-align: left; font: inherit; font-size: 15px; color: #949ba4; background: transparent; border: 0; border-radius: 4px; padding: 6px 8px; cursor: pointer; }
.dc-ch:hover { background: #35373c; color: #dbdee1; } .dc-ch.on { background: #404249; color: #f2f3f5; }
.dc-none { color: #80848e; font-size: 13px; padding: 6px 16px; }
.dc-foot { margin-top: auto; background: #232428; padding: 8px 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: #f2f3f5; }
.dc-foot div div { font-size: 11.5px; color: #949ba4; }
.dc-main { display: flex; flex-direction: column; min-height: 0; }
.dc-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #1f2023; color: #f2f3f5; }
.dc-head span { color: #949ba4; font-size: 13px; }
.dc-search { margin-left: auto; background: #1e1f22; border: 0; border-radius: 4px; color: #dbdee1; padding: 5px 8px; font: inherit; font-size: 13px; width: 180px; }
.dc-btn { background: transparent; border: 0; color: #b5bac1; font-size: 18px; cursor: pointer; }
.dc-msgs { flex: 1; overflow-y: auto; padding: 12px 0 16px; }
.dc-day { display: flex; align-items: center; margin: 16px 16px 8px; } .dc-day::before, .dc-day::after { content: ''; flex: 1; height: 1px; background: #3f4147; }
.dc-day span { font-size: 12px; font-weight: 600; color: #949ba4; padding: 0 8px; }
.dc-msg { display: flex; gap: 14px; padding: 4px 16px; margin-top: 12px; }
.dc-msg:hover { background: #2e3035; }
.dc-msg.cont { margin-top: 0; padding-left: 16px; } .dc-msg .dc-t { width: 40px; flex: 0 0 40px; font-size: 11px; color: transparent; text-align: right; padding-top: 3px; } .dc-msg.cont:hover .dc-t { color: #949ba4; }
.dc-av { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; }
.dc-who b { color: #f2f3f5; font-weight: 500; } .dc-who span { font-size: 12px; color: #949ba4; margin-left: 4px; }
.dc-text { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.375; }
.dc-acc { font-size: 12px; color: #00a8fc; margin-left: 6px; }
.dc-empty { color: #949ba4; text-align: center; padding: 40px; }
.dc-setup { margin: 16px; background: #2b2d31; border-radius: 8px; padding: 18px 20px; } .dc-setup h3 { color: #f2f3f5; margin: 0 0 8px; } .dc-setup a { color: #00a8fc; } .dc-setup ol { padding-left: 20px; line-height: 1.6; }
.dc-compose { padding: 0 16px 20px; } .dc-compose textarea { width: 100%; background: #383a40; border: 0; border-radius: 8px; color: #dbdee1; padding: 11px 14px; font: inherit; font-size: 15px; resize: none; }
.dc-compose textarea:disabled { opacity: .6; }
/* Ajustes de ancho */
.wa-wrap { grid-template-columns: minmax(250px, 34%) minmax(0, 1fr); }
.dc-head b { white-space: nowrap; } .dc-head span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dc-wrap { grid-template-columns: minmax(180px, 26%) minmax(0, 1fr); }
.tr-search { width: auto; flex: 1 1 140px; max-width: 260px; }

/* ---------- Calendario ---------- */
.cal-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.cal-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: sticky; top: 12px; }
.cal-side h4 { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cal-cal { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; padding: 3px 0; }
.cal-cal label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cal-legend { display: grid; gap: 4px; } .cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cal-warn { background: var(--pending-soft, #fff4e0); color: var(--ink); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-top: 12px; display: flex; flex-direction: column; }
.cal-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-bar h2 { margin: 0 8px; font-size: 20px; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow span { font-size: 12px; color: var(--muted); padding: 4px 6px; font-weight: 600; }
.cal-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-cell { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-cell.other { background: var(--bg); } .cal-cell.other .cal-dnum { color: var(--muted); }
.cal-dnum { font-size: 12px; font-weight: 600; width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 50%; }
.cal-cell.today .cal-dnum { background: var(--blue); color: #fff; }
.cal-ev { border: 0; text-align: left; font: inherit; font-size: 12px; padding: 2px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--ink); border-left: 3px solid var(--c); }
.cal-ev.allday { background: var(--c); color: #fff; }
.cal-ev:hover { filter: brightness(.95); }
.cal-more { border: 0; background: none; color: var(--muted); font-size: 12px; text-align: left; cursor: pointer; padding: 0 6px; }
.cal-week { display: grid; grid-template-rows: auto auto 1fr; }
.cal-whead, .cal-allday, .cal-wbody { display: grid; grid-template-columns: 52px repeat(var(--cols), 1fr); }
.cal-whead span { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0; cursor: pointer; }
.cal-whead span b { display: block; font-size: 20px; color: var(--ink); }
.cal-whead span.today b { color: var(--blue); }
.cal-allday { border-bottom: 1px solid var(--line); min-height: 24px; } .cal-allday > div { padding: 2px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
.cal-wbody { max-height: 62vh; overflow-y: auto; position: relative; }
.cal-hours span { display: block; font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-6px); }
.cal-col { position: relative; border-left: 1px solid var(--line); }
.cal-col.today { background: color-mix(in srgb, var(--blue) 4%, transparent); }
.cal-slot { border-top: 1px solid var(--line); cursor: copy; } .cal-slot:hover { background: color-mix(in srgb, var(--blue) 7%, transparent); }
.cal-block { position: absolute; left: 3px; right: 3px; border: 0; border-radius: 6px; padding: 3px 6px; text-align: left; font: inherit; font-size: 12px; overflow: hidden; cursor: pointer; background: var(--c); color: #fff; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.cal-block b { flex: 0 0 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cal-block span { flex: 0 0 auto; opacity: .9; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; } .cal-dot.big { width: 16px; height: 16px; border-radius: 4px; margin-top: 6px; }
.cal-agenda .item { align-items: center; }
.ev-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; padding-right: 40px; }
.ev-rows { display: grid; gap: 10px; font-size: 14px; margin-bottom: 14px; }
.ev-att { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); margin: 2px 4px 2px 0; }
.ev-att.accepted { border-color: var(--green); } .ev-att.declined { text-decoration: line-through; color: var(--muted); }
.ev-desc { white-space: pre-wrap; font-size: 13px; color: var(--muted); max-height: 160px; overflow: auto; background: var(--bg); padding: 8px; border-radius: 8px; }
.nm-chips { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; }
.hm-item { cursor: pointer; } .hm-when { width: 72px; display: flex; flex-direction: column; flex: 0 0 auto; }
.hm-when b { font-size: 15px; } .hm-when span { font-size: 11px; color: var(--muted); } .hm-when.live b { color: var(--danger); }
@media (max-width: 900px) { .cal-wrap { grid-template-columns: 1fr; } .cal-side { position: static; } .cal-cell { min-height: 72px; } }

/* Reuniones compactas en Inicio */
#hMeet { padding: 12px 16px; }
.hm-head { margin-bottom: 6px; } .hm-head h2 { font-size: 16px; }
.hm-list { display: flex; flex-direction: column; }
.hm-row { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; min-height: 30px; }
.hm-row:last-child { border-bottom: 0; } .hm-row:hover { background: var(--bg); }
.hm-t { flex: 0 0 130px; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; } .hm-t.live { color: var(--danger); font-weight: 700; }
.hm-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hm-name .mini { font-weight: 400; }
.hm-act { font-size: 12px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); text-decoration: none; color: var(--blue); }
.hm-act.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.hm-hide { border: 0; background: none; color: var(--muted); cursor: pointer; opacity: 0; font-size: 12px; padding: 2px 4px; }
.hm-row:hover .hm-hide { opacity: 1; } .hm-hide:hover { color: var(--danger); }
@media (hover: none) { .hm-hide { opacity: .6; } }

/* ---------- Archivos (tareas, cuentas) ---------- */
.fp-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border: 1.5px dashed var(--line); border-radius: 10px; }
.fp-drop.over, .box-drop.over { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, transparent); }
.fp-link { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; } .fp-link input { flex: 1 1 220px; }
.fp-list { margin-top: 8px; display: flex; flex-direction: column; }
.fp-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 4px; }
.fp-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.fp-ic { font-size: 18px; } .fp-name { font-weight: 600; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
.fp-item .mini { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-act { border: 0; background: none; color: var(--muted); cursor: pointer; text-decoration: none; font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.fp-act:hover { background: var(--bg); color: var(--ink); } .fp-act.danger { color: var(--danger); }

/* ---------- BOX ---------- */
.box-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.box-side { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; position: sticky; top: 12px; }
.box-f { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink); }
.box-f span { margin-left: auto; font-size: 12px; color: var(--muted); } .box-f:hover { background: var(--bg); } .box-f.on { background: var(--blue-soft, #e8f0fe); font-weight: 700; }
.box-main { min-width: 0; }
.box-drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 10px; text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.box-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.box-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; transition: box-shadow .15s; }
.box-card:hover { box-shadow: var(--shadow); }
.box-card b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.box-thumb { height: 110px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.box-thumb img { width: 100%; height: 100%; object-fit: cover; } .box-thumb span { font-size: 42px; }
.box-acts { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.box-acts select { flex: 1; min-width: 0; font-size: 12px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.box-acts a, .box-acts button { border: 0; background: none; cursor: pointer; color: var(--muted); text-decoration: none; font-size: 13px; padding: 2px 6px; }
@media (max-width: 800px) { .box-wrap { grid-template-columns: 1fr; } .box-side { position: static; flex-direction: row; flex-wrap: wrap; } }

/* ---------- Quick-Wins y Vista 360 ---------- */
.qw-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.qw-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.qw-col h3 { margin: 0 0 8px; font-size: 14px; }
.qw-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.qw-row:last-child { border-bottom: 0; } .qw-row:hover { background: var(--bg); } .qw-row .sub { font-size: 12px; color: var(--muted); }
.qw-st { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid; background: var(--surface); cursor: pointer; font-size: 12px; line-height: 1; display: grid; place-items: center; }
.qw-box { display: flex; flex-direction: column; gap: 4px; }
.v3-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.v3-tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; background: var(--surface); }
.v3-tile:hover { border-color: var(--blue); } .v3-tile .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.v3-tile .n { font-size: 22px; font-weight: 800; }
.v3-table { width: 100%; border-collapse: collapse; font-size: 13px; } .v3-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px; } .v3-table td { padding: 5px 4px; border-top: 1px solid var(--line); }
.v3-msg { font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--line); }
#h360 { padding: 12px 16px; }
.cm-from { font: inherit; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; background: var(--surface); color: var(--ink); }
@media (max-width: 900px) { .qw-board { grid-template-columns: 1fr 1fr; } }
.fp-link[hidden], .fp-drop[hidden] { display: none; }

.qw-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 2px 0 6px; } .qw-bar i { display: block; height: 100%; background: var(--green); }

.qw-ref { display: inline-block; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--line); border-radius: 4px; padding: 0 5px; margin-right: 2px; }
.rp-list { max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
.rp-item { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); } .rp-item:last-child { border-bottom: 0; }
.rp-item.rp-dup { opacity: .6; } .rp-chk { padding-top: 2px; } .rp-item .sub { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.rp-sel { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .rp-sel select { font-size: 12px; padding: 3px 6px; }

.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cx-card { display: flex; flex-direction: column; gap: 8px; border-top: 3px solid var(--line); transition: box-shadow .15s, transform .15s; }
.cx-card.on { border-top-color: var(--green); } .cx-card:hover { box-shadow: 0 8px 24px rgba(15,23,42,.08); transform: translateY(-1px); }
.cx-card p { margin: 0; } .cx-head { display: flex; gap: 12px; align-items: center; } .cx-head h2 { margin: 0 0 3px; font-size: 16px; }
.cx-logo { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.tr-item-row { display: flex; align-items: center; gap: 8px; } .tr-item-row .grow { cursor: text; }
.tr-mini { border: 0; background: none; color: var(--muted); cursor: pointer; opacity: 0; font-size: 12px; } .tr-item-row:hover .tr-mini { opacity: 1; }
.tr-cmact { font-size: 12px; margin-top: 3px; } .tr-cmact a { color: var(--muted); }
.tr-sec h3 .grow { flex: 1; } .tr-sec h3 { display: flex; align-items: center; gap: 6px; }
.tr-sbtn.tr-danger { color: var(--danger); }

.home-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-col .panel-head h2 { white-space: nowrap; }

/* ======================================================================
   Look azul (23/11): claro, preciso y con movimiento que acompaña.
   Movimiento corto (150–300 ms, ease-out), nada entra desde cero,
   y quien pide menos movimiento no lo ve.
   ====================================================================== */
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--ink); }
input, textarea { caret-color: var(--brand); }
a { text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
td, .kpi .n, .chip .c, .mini { font-variant-numeric: tabular-nums; }
body { letter-spacing: -.003em; }
h1, h2, h3 { letter-spacing: -.02em; }
body, .topbar, .nav, .panel, .kpi, .assistant, .modal { transition: background-color .25s var(--ease-out), border-color .25s var(--ease-out), color .25s var(--ease-out); }

/* ---------- Barra superior: blanca, limpia ---------- */
.topbar { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); color: var(--ink); box-shadow: none; border-bottom: 1px solid var(--line); }
.brand-mark { background: var(--brand); color: #fff; border-radius: 10px; box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 70%, transparent); }
.brand b { color: var(--ink); }
.brand b span { color: var(--brand); }
.brand small { color: var(--muted); opacity: 1; }
.gsearch { background: var(--surface-2); box-shadow: none; border: 1px solid transparent; color: var(--muted); border-radius: 10px; transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.gsearch:focus-within { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.gsearch input { color: var(--ink); }
.topbar .btn, .navtoggle { background: transparent !important; border-color: transparent !important; color: var(--ink-2) !important; }
.topbar .btn:hover, .navtoggle:hover { background: var(--surface-2) !important; }
.role { background: var(--surface-2); color: var(--muted); }
.role.admin { background: var(--brand-soft); color: var(--brand-strong); }
.themebtn .ico { transition: transform .35s var(--ease-out); }
.themebtn:hover .ico { transform: rotate(-20deg); }

/* ---------- Menú lateral claro ---------- */
.nav { background: var(--side); color: var(--side-ink); border-right: 1px solid var(--line); padding: 12px 10px; }
.nav button { color: var(--side-ink); border-radius: 10px; transition: background-color .15s var(--ease-out), color .15s var(--ease-out); }
.nav button:hover { background: var(--side-hover); color: var(--ink); }
.nav button.on { background: var(--side-on); color: var(--side-on-ink); font-weight: 700; }
:root:not([data-theme="dark"]) .nav button.on { box-shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 2px 8px -2px rgba(15, 27, 45, .1); }
:root:not([data-theme="dark"]) .nav { border-right-color: #dbe1ea; }
:root:not([data-theme="dark"]) .nav .phase { color: #6b7789; }
.nav button.on::before { display: none; }
.nav button .ico { transition: transform .2s var(--ease-out); }
.nav button:hover .ico { transform: translateX(1px); }
.nav button.on .ico { color: var(--brand); }
.nav .phase { color: var(--muted); padding-top: 14px; font-size: 10.5px; }
.nav .sep { background: var(--line); }
.nav button .badge { background: var(--brand); }

/* ---------- Encabezado de cada página ---------- */
.hero { background: transparent; border: 0; box-shadow: none; padding: 4px 2px 6px; border-radius: 0; overflow: visible; align-items: center; }
.hero::after { display: none; }
.hero .crumbs, .head .crumbs { display: none; }
.hero h1, .head h1 { font-size: 27px; font-weight: 800; letter-spacing: -.025em; }
.hero p { font-size: 14px; margin-top: 6px; }

/* ---------- Botones: responden al toque ---------- */
.btn { border-radius: 10px; transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out), box-shadow .15s var(--ease-out), transform .12s var(--ease-out), color .15s var(--ease-out); }
.btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn:active:not([disabled]) { transform: scale(.97); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 2px color-mix(in srgb, var(--brand) 30%, transparent), 0 6px 14px -6px color-mix(in srgb, var(--brand) 60%, transparent); }
.btn.primary:hover { filter: none; background: var(--brand-strong); border-color: var(--brand-strong); }
:root[data-theme="dark"] .btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #fff); border-color: transparent; }
.btn.ghost:hover { background: var(--blue-soft); }
.chip, .tr-sbtn, .iconbtn { transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out), color .15s var(--ease-out), transform .12s var(--ease-out); }
.chip:active, .iconbtn:active { transform: scale(.97); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tabs button { transition: color .15s var(--ease-out), border-color .2s var(--ease-out); }
.tabs button.on { border-bottom-color: var(--brand); }

/* ---------- Tarjetas: se levantan apenas y siguen al mouse con una luz suave ---------- */
.panel, .kpi, .mcard, .cx-card, .kcard, .item { --mx: 50%; --my: 50%; }
.panel { border-color: var(--line); border-radius: var(--radius); }
.panel h2 { font-size: 16px; }
.panel, .kpi, .mcard, .cx-card { transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .25s var(--ease-out), background-color .25s var(--ease-out); }
.panel:hover { border-color: var(--line-2); background: radial-gradient(520px circle at var(--mx) var(--my), color-mix(in srgb, var(--brand) 4%, transparent), transparent 65%), var(--surface); }
.kpi { border-color: var(--line); padding: 16px 18px; gap: 4px; border-radius: var(--radius); }
.kpi::after { display: none; }
.kpi .label { display: flex; align-items: center; gap: 7px; text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
.kpi .label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--kpi-color, var(--brand)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kpi-color, var(--brand)) 18%, transparent); }
.kpi:nth-child(1) { --kpi-color: var(--brand); }
.kpi:nth-child(2) { --kpi-color: #f59e0b; }
.kpi:nth-child(3) { --kpi-color: var(--green); }
.kpi:nth-child(4) { --kpi-color: var(--violet); }
.kpi .n { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.kpi:hover, .mcard:hover, .cx-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); background: radial-gradient(340px circle at var(--mx) var(--my), color-mix(in srgb, var(--brand) 8%, transparent), transparent 65%), var(--surface); }
.kcard { transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), border-color .2s var(--ease-out); }
.kcard:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.mcard { border-left: 1px solid var(--line); border-color: var(--line); }
.mcard .mtop .tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; }
.cx-card, .cx-card.on { border-top: 1px solid var(--line); }
.metric { background: var(--nav); }
.metric b { color: #9cc0ff; }
.insight { background: linear-gradient(135deg, #0f1f3d 0%, #1f3f86 100%); }
.insight .badge { background: #9cc0ff; color: #0f1f3d; }
.pres-cover { background: var(--brand); color: #fff; }
.pres-cover h1, .pres-cover small { color: #fff; }
.kcol { border-top-width: 3px; }

/* Filas de listas y tablas */
th { background: var(--surface-2); letter-spacing: .04em; }
tbody tr td { transition: background-color .12s var(--ease-out); }
tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 70%, var(--surface)); }
.item, .qw-row, .hm-row { transition: background-color .12s var(--ease-out), border-color .15s var(--ease-out); }
.item:hover { border-color: var(--line-2); }
.bar > i { transform-origin: left center; }

/* Campos de formulario */
.field input, .field select, .field textarea, .search, .selects select { border-radius: 10px; transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- Al entrar a una página, el contenido sube en cascada ---------- */
.page-enter > * { animation: aio-rise .38s var(--ease-out) both; }
.page-enter > *:nth-child(2) { animation-delay: .04s; }
.page-enter > *:nth-child(3) { animation-delay: .08s; }
.page-enter > *:nth-child(4) { animation-delay: .12s; }
.page-enter > *:nth-child(5) { animation-delay: .16s; }
.page-enter > *:nth-child(n+6) { animation-delay: .2s; }
.page-enter .kpi { animation: aio-rise .4s var(--ease-out) both; }
.page-enter .kpi:nth-child(2) { animation-delay: .05s; }
.page-enter .kpi:nth-child(3) { animation-delay: .1s; }
.page-enter .kpi:nth-child(4) { animation-delay: .15s; }
.page-enter .bar > i { animation: aio-grow .7s var(--ease-out) .15s both; }
@keyframes aio-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes aio-grow { from { transform: scaleX(0); } }

/* ---------- Modales, ficha y avisos: entran desde casi su tamaño ---------- */
.scrim, .modal-bg { background: rgba(15, 27, 45, .38); backdrop-filter: blur(2px); }
.modal-bg { animation: aio-fade .2s var(--ease-out); }
.modal { animation: aio-pop .24s var(--ease-out); transform-origin: 50% 40%; border: 1px solid var(--line); border-radius: 18px; }
.drawer { animation: aio-slide .3s var(--ease-out); }
.drawer-head { background: var(--surface); }
.toast { animation: aio-toast .28s var(--ease-out); background: var(--ink); color: var(--surface); border-radius: 12px; }
@keyframes aio-fade { from { opacity: 0; } }
@keyframes aio-pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes aio-slide { from { transform: translateX(24px); opacity: .6; } }
@keyframes aio-toast { from { opacity: 0; transform: translate(-50%, 10px) scale(.97); } }

/* ---------- Login ---------- */
.login { background: radial-gradient(900px 420px at 50% -10%, var(--brand-soft), transparent 70%), var(--bg); }
.login-card { border: 1px solid var(--line); border-radius: 20px; }

/* ======================================================================
   El asistente como personaje: cada usuario le pone nombre y color.
   ====================================================================== */
.bot { display: inline-block; flex: none; overflow: visible; }
.bot .b-body { fill: var(--bot, #2f6bff); }
.bot .b-visor { fill: #0f1b3d; }
.bot .b-eye { fill: #fff; transform-box: fill-box; transform-origin: center; animation: bot-blink 5s infinite; }
.bot .b-eye + .b-eye { animation-delay: .02s; }
.bot .b-cheek { fill: #ff8fa3; opacity: .55; }
.bot .b-ant { fill: var(--bot, #2f6bff); }
.bot .b-ant-line { stroke: var(--bot, #2f6bff); }
.bot .b-shine { fill: #fff; opacity: .28; }
.bot.float { animation: bot-float 4.5s ease-in-out infinite; }
.bot.thinking .b-eyes { animation: bot-look 1.6s ease-in-out infinite; }
.bot.thinking .b-ant { animation: bot-pulse 1s ease-in-out infinite; }
.bot.happy { animation: bot-hop .6s var(--ease-out); }
.bot.happy .b-eye { animation: none; transform: scaleY(.45) translateY(-1px); }
@keyframes bot-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes bot-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes bot-look { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-2.5px); } 70% { transform: translateX(2.5px); } }
@keyframes bot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes bot-hop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-5px) scale(1.04); } 100% { transform: translateY(0) scale(1); } }
[data-bot="azul"] { --bot: #2f6bff; } [data-bot="indigo"] { --bot: #5b5cf0; } [data-bot="turquesa"] { --bot: #0ea5a4; }
[data-bot="coral"] { --bot: #f2643d; } [data-bot="ambar"] { --bot: #f0a20b; } [data-bot="rosa"] { --bot: #e5488a; }

.assistant { background: var(--surface); }
.as-head { background: var(--surface); padding: 12px 14px; }
.as-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.as-id b { display: block; font-size: 15px; color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
.as-id small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.as-id small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.as-id.busy small::before { background: var(--bot, var(--brand)); animation: bot-pulse 1s ease-in-out infinite; }
.as-hello { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 10px 10px; animation: aio-rise .4s var(--ease-out) both; }
.as-hello h3 { font-size: 18px; font-weight: 800; }
.as-hello p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 34ch; }
.as-row { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.as-row .msg { max-width: calc(100% - 34px); }
.msg { animation: aio-rise .25s var(--ease-out) both; }
.msg.user { background: var(--brand); color: var(--brand-ink); }
.msg.bot { background: var(--surface-2); color: var(--ink-2); }
.preview { animation: aio-pop .25s var(--ease-out) both; }
.typing { display: flex; align-items: center; gap: 8px; font-style: normal; }
.typing .dots { display: inline-flex; gap: 3px; padding: 9px 12px; background: var(--surface-2); border-radius: 14px; border-bottom-left-radius: 4px; }
.typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dot-wave 1.1s ease-in-out infinite; }
.typing .dots i:nth-child(2) { animation-delay: .15s; } .typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot-wave { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
.as-suggest button { transition: border-color .15s var(--ease-out), color .15s var(--ease-out), background-color .15s var(--ease-out); }
.as-suggest button:hover { border-color: var(--bot, var(--brand)); color: var(--ink); background: var(--surface-2); }
.as-input textarea { border-radius: 12px; transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.as-input textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.as-input .btn.primary { background: var(--brand); border-color: var(--brand); }
#toggleAs { gap: 7px; }

/* Mi perfil: apariencia y asistente */
.pf-sec { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.pf-sec h3 { font-size: 14px; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 2px; align-self: flex-start; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; transition: background-color .15s var(--ease-out), color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.bot-pick { display: flex; gap: 14px; align-items: center; }
.bot-pick .field { flex: 1; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); background: var(--bot); box-shadow: 0 0 0 1px var(--line-2); transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.swatches button:hover { transform: scale(1.08); }
.swatches button.on { box-shadow: 0 0 0 2px var(--bot); }

/* Quien prefiere menos movimiento, no lo ve */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .btn:active:not([disabled]), .kpi:hover, .mcard:hover, .cx-card:hover, .kcard:hover { transform: none; }
}

/* Inicio: los encabezados de Tareas y Quick-Wins entran en una línea */
.home-col .panel-head { align-items: center; }
.home-col .panel-head .row-actions { flex-wrap: nowrap; }
.home-col .panel-head select { max-width: 130px; }
.home-col .panel-head .row-actions > * { white-space: nowrap; }
.home-col .panel-head .row-actions { min-width: 0; }
.home-col .panel-head .row-actions .mini { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.home-col .panel-head { gap: 12px; } .home-col .panel-head h2 { flex: none; }
.home-col .panel-head select { min-width: 0; flex: 0 1 auto; }

/* ======================================================================
   Bimo (23/11): panel con ancho propio, historial, archivos e informes.
   ====================================================================== */
.app { grid-template-columns: var(--navw) minmax(0, 1fr) var(--asw, 400px); }
.app.no-assistant { grid-template-columns: var(--navw) minmax(0, 1fr) 0; }
.assistant { position: relative; }
.as-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 3; }
.as-resize::after { content: ""; position: absolute; left: 3px; top: 50%; width: 2px; height: 44px; margin-top: -22px; border-radius: 2px; background: var(--line-2); opacity: 0; transition: opacity .15s var(--ease-out), background-color .15s var(--ease-out); }
.as-resize:hover::after, body.resizing .as-resize::after { opacity: 1; background: var(--brand); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing .app { transition: none; }
.as-tools { flex-wrap: nowrap; }
.as-tools .btn { padding: 6px 8px; }
.as-tools .btn.on { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.as-head { gap: 6px; }

.as-input { flex-direction: column; gap: 8px; }
.as-input textarea { width: 100%; min-height: 84px; max-height: 260px; line-height: 1.45; font-size: 14px; }
.as-bar { display: flex; align-items: center; gap: 8px; }
.as-bar .btn.primary { margin-left: auto; }
.as-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.as-files { display: flex; flex-wrap: wrap; gap: 6px; }
.as-files:empty { display: none; }
.as-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-strong); font-size: 12.5px; font-weight: 600; animation: aio-pop .2s var(--ease-out) both; }
.as-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-chip button { border: 0; background: transparent; color: inherit; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; padding: 0; }
.as-chip button:hover { background: color-mix(in srgb, var(--brand) 15%, transparent); }
.as-chip.up { opacity: .75; }
.as-chip.mine { align-self: flex-end; padding-right: 10px; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: aio-spin .7s linear infinite; }
@keyframes aio-spin { to { transform: rotate(360deg); } }
.assistant.drop::after { content: "Soltá los archivos para compartírselos"; position: absolute; inset: 10px; border: 2px dashed var(--brand); border-radius: 16px; background: color-mix(in srgb, var(--brand-soft) 85%, transparent); display: grid; place-items: center; font-weight: 700; color: var(--brand-strong); z-index: 4; pointer-events: none; }

.as-report { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); animation: aio-pop .25s var(--ease-out) both; color: var(--brand); }
.as-report .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.as-report b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-report .btn { text-decoration: none; }
.as-report .btn.busy { pointer-events: none; opacity: .8; }

.as-hist { display: flex; flex-direction: column; gap: 10px; animation: aio-rise .25s var(--ease-out) both; }
.as-hist-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.as-hist .search { flex: none; width: 100%; }
.as-hlist { display: flex; flex-direction: column; gap: 6px; }
.as-hrow { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out), transform .15s var(--ease-out); }
.as-hrow:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--surface-2); }
.as-hrow:active { transform: scale(.99); }
.as-hrow.on { border-color: var(--brand); }
.as-hrow.static { cursor: default; padding: 0; border: 0; background: none; }
.as-hrow .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.as-hrow b { color: var(--ink); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-hrow .iconbtn { opacity: 0; transition: opacity .15s var(--ease-out); }
.as-hrow:hover .iconbtn { opacity: 1; }

@media (max-width: 1100px) {
  .app, .app.no-assistant { grid-template-columns: var(--navw) minmax(0, 1fr); }
  .assistant { position: fixed; width: min(var(--asw, 420px), 100%); }
}
@media (max-width: 720px) {
  .app, .app.no-assistant { grid-template-columns: minmax(0, 1fr); }
  .as-resize, .as-modes [data-asmode=grande], .as-hint { display: none; }
}

/* Si Bimo ocupa más lugar, el contenido se reacomoda según el ancho que le queda */
.main-inner { container-type: inline-size; }
@container (max-width: 820px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
@container (max-width: 640px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.as-hrow.static .as-report { flex: 1; min-width: 0; }

/* Ideas: quién la subió y su línea de tiempo */
.idea-by { display: flex; align-items: center; gap: 9px; }
.idea-by > div { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.idea-by b { color: var(--ink); font-size: 13.5px; }
.idea-pt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.itl { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; }
.itl li { position: relative; padding: 0 0 9px 18px; display: flex; flex-direction: column; font-size: 12.5px; line-height: 1.3; }
.itl li::before { content: ""; position: absolute; left: 3px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); box-shadow: 0 0 0 3px var(--surface); z-index: 1; }
.itl li::after { content: ""; position: absolute; left: 6px; top: 8px; bottom: -4px; width: 1px; background: var(--line); }
.itl > li:last-child { padding-bottom: 0; }
.itl > li:last-child::after { display: none; }
.itl li b { color: var(--ink-2); font-weight: 600; }
.itl li span { color: var(--muted); font-size: 11.5px; }
.itl li.it-creada::before { background: var(--brand); }
.itl li.it-backlog::before { background: var(--violet); }
.itl li.it-estado::before, .itl li.it-item_estado::before { background: var(--blue); }
.itl li.done::before { background: var(--green); }
.itl .itl-more::before { background: transparent; border: 1px dashed var(--line-2); box-sizing: border-box; }
.itl details summary { cursor: pointer; color: var(--blue); font-size: 12px; list-style: none; }
.itl details summary::-webkit-details-marker { display: none; }
.itl details[open] summary { margin-bottom: 8px; }
.itl details .itl { margin-left: -18px; }

/* Quick-Wins tipo Trello: tarjetas que se seleccionan, se arrastran y tienen varios responsables */
.qw-help { margin: -6px 0 0; }
.qw-col { display: flex; flex-direction: column; background: var(--surface-2); border-color: var(--line); transition: background-color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.qw-col h3 { display: flex; align-items: center; gap: 6px; }
.qw-col h3 .mini { font-weight: 600; }
.qw-col.over { background: var(--brand-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 45%, transparent); }
.qw-selall { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.qw-selall:hover { background: var(--surface); color: var(--brand-strong); }
.qw-cards { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 60px; }
.qw-empty { flex: 1; min-height: 60px; border: 1.5px dashed var(--line-2); border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.qw-card { position: relative; display: flex; gap: 8px; align-items: flex-start; padding: 10px 10px 10px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm); cursor: grab; font-size: 13px; transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), border-color .15s var(--ease-out), opacity .15s var(--ease-out); }
.qw-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.qw-card:active { cursor: grabbing; }
.qw-card.sel { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.qw-card.dragging { opacity: .45; transform: scale(.98); }
.qw-card.landed { animation: aio-pop .25s var(--ease-out); }
.qw-card .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.qw-card b { color: var(--ink); font-weight: 600; line-height: 1.35; }
.qw-card .sub { font-size: 12px; color: var(--muted); }
.qw-check { display: grid; place-items: center; padding: 2px; cursor: pointer; }
.qw-check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; margin: 0; }
.qw-card:not(.sel):not(:hover) .qw-check input:not(:checked) { opacity: .45; }
.qw-who { display: flex; align-items: center; gap: 6px; margin-top: 2px; min-width: 0; }
.qw-who .mini { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qw-owners { display: inline-flex; flex: none; }
.qw-owners .avatar { box-shadow: 0 0 0 2px var(--surface); }
.qw-owners .avatar + .avatar { margin-left: -4px; }
.qw-owners .avatar.more { background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 700; }

.qw-bulk { position: sticky; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s var(--ease-out), transform .2s var(--ease-out); }
.qw-bulk.on { opacity: 1; transform: none; pointer-events: auto; }
.qw-bulk b { color: var(--ink); margin-right: 2px; }
.qw-bulk-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.owner-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.owner-pick .op { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 4px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13px; transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out), color .15s var(--ease-out), transform .12s var(--ease-out); }
.owner-pick .op:hover { border-color: var(--brand); }
.owner-pick .op:active { transform: scale(.97); }
.owner-pick .op.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
@media (max-width: 720px) { .qw-bulk { bottom: 8px; } .qw-bulk-sep { display: none; } }

/* ======================================================================
   PC, tablet y teléfono (23/11). Tablet: menú de íconos que se abre como cajón.
   Teléfono: barra de abajo con lo más usado, menú en cajón, ventanas que suben
   desde abajo y campos de 16px para que iPhone no haga zoom.
   ====================================================================== */
.tabbar, .nav-scrim { display: none; }
.app { height: 100vh; height: 100dvh; }

@media (max-width: 1100px) {
  .app, .app.nav-collapsed { --navw: 64px; }
  .navtoggle { display: inline-flex !important; }
  .app:not(.nav-open) .nav { padding: 12px 8px; }
  .app:not(.nav-open) .nav button { justify-content: center; padding: 10px 0; }
  .app:not(.nav-open) .nav button span, .app:not(.nav-open) .nav .phase { display: none; }
  .app:not(.nav-open) .nav .phase + button { margin-top: 10px; }
  .app.nav-open .nav { position: relative; z-index: 44; width: 272px; box-shadow: var(--shadow); animation: nav-in .26s var(--ease-out); }
  .app.nav-open .nav button span { display: inline; }
  .app.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 43; background: rgba(15, 27, 45, .32); animation: aio-fade .2s var(--ease-out); }
  .assistant { width: min(var(--asw, 420px), 100%); }
  .qw-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@keyframes nav-in { from { transform: translateX(-16px); opacity: .6; } }

@media (max-width: 720px) {
  .app, .app.no-assistant, .app.nav-collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  /* Barra de arriba compacta */
  .topbar { flex-wrap: nowrap; gap: 6px; min-height: 56px; padding: env(safe-area-inset-top, 0px) max(10px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px)); }
  .brand { min-width: 0; gap: 8px; }
  .brand > div { display: none; }
  .userbox { gap: 2px; }
  .userbox .role, #toggleAs span, .userbtn span:not(.avatar) { display: none; }
  .topbar .btn.small { padding: 8px; min-width: 38px; min-height: 38px; justify-content: center; }
  .userbtn { padding: 3px !important; }
  /* Menú: cajón desde la izquierda */
  .nav { display: none; }
  .app.nav-open .nav { display: flex; position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 84vw); z-index: 46; flex-direction: column; overflow-y: auto; gap: 2px;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 12px calc(16px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
  .app.nav-open .nav button { width: 100%; padding: 11px 12px; font-size: 15px; }
  .app.nav-open .nav .phase { display: block; }
  .app.nav-open .nav-scrim { z-index: 45; }
  /* Barra de abajo */
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-column: 1 / -1; z-index: 6; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--line); padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); }
  .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: 10.5px; font-weight: 700; padding: 5px 0 3px; border-radius: 12px; min-height: 48px; transition: color .15s var(--ease-out), transform .12s var(--ease-out); -webkit-tap-highlight-color: transparent; }
  .tabbar button .ico { width: 22px; height: 22px; }
  .tabbar button.on { color: var(--brand); }
  .tabbar button:active { transform: scale(.94); }
  /* Contenido */
  .main { padding: 16px max(14px, env(safe-area-inset-right, 0px)) 28px max(14px, env(safe-area-inset-left, 0px)); }
  .main-inner { gap: 14px; }
  .hero { gap: 12px; }
  .hero h1, .head h1 { font-size: 23px; }
  .hero > .btn, .hero > .row-actions { width: 100%; justify-content: flex-start; }
  .hero > .row-actions .btn { flex: 1 1 auto; justify-content: center; }
  .panel { padding: 14px; }
  .panel-head { flex-wrap: wrap; row-gap: 8px; }
  .kpi { padding: 13px 14px; }
  .kpi .n { font-size: 26px; }
  .toolbar { gap: 6px; }
  .toolbar > select, .toolbar > .search { flex: 1 1 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 2px 14px 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs button { flex: none; }
  .mgrid { grid-template-columns: minmax(0, 1fr); }
  /* Tableros que se deslizan de a una columna, como Trello en el celu */
  .kanban, .qw-board { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 86%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 0 14px 8px; scroll-padding: 14px; }
  .kcol, .qw-col { scroll-snap-align: start; max-height: none; }
  .qw-bulk { bottom: 8px; padding: 10px; }
  .qw-bulk .btn { flex: 1 1 auto; justify-content: center; }
  /* Ventanas: suben desde abajo y ocupan el ancho */
  .modal-bg { place-items: end stretch; padding: 0; }
  .modal { width: 100% !important; max-height: 92vh; max-height: 92dvh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 20px 16px calc(18px + env(safe-area-inset-bottom, 0px)); animation: sheet-up .3s var(--ease-out); }
  .modal::before { content: ""; align-self: center; width: 38px; height: 4px; border-radius: 4px; background: var(--line-2); margin: -8px 0 2px; flex: none; }
  .modal .row-actions { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom, 0px)); background: var(--surface); padding: 10px 0 calc(4px + env(safe-area-inset-bottom, 0px)); margin-bottom: calc(-18px - env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
  .modal .row-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .drawer { width: 100%; }
  .drawer-head { padding: 12px 14px; }
  .drawer-body { padding: 14px 14px calc(24px + env(safe-area-inset-bottom, 0px)); }
  /* Bimo ocupa toda la pantalla */
  .assistant { width: 100%; padding-top: env(safe-area-inset-top, 0px); }
  .as-input { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .as-input textarea { min-height: 64px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 32px); text-align: center; }
  /* iPhone no hace zoom en campos de 16px o más */
  input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea { font-size: 16px; }
  .btn { min-height: 38px; }
  .btn.small { min-height: 34px; }
  table { font-size: 13.5px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }

/* En pantallas táctiles no hay "hover": nada salta al tocar */
@media (hover: none) {
  .kpi:hover, .mcard:hover, .cx-card:hover, .qw-card:hover, .kcard:hover { transform: none; box-shadow: var(--shadow-sm); }
  .panel:hover { background: var(--surface); }
  .as-hrow .iconbtn { opacity: 1; }
  .qw-check input { opacity: 1 !important; }
}

/* Inicio (23/11): seis cards que son acceso directo */
.kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@container (max-width: 1100px) { .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 640px) { .kpis.k6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-go { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), border-color .18s var(--ease-out); }
.kpi-go .kgo { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--muted); background: var(--surface-2, var(--brand-soft)); opacity: .55; transition: opacity .18s var(--ease-out), transform .18s var(--ease-out), color .18s; }
.kpi-go:hover { border-color: color-mix(in srgb, var(--kpi-color, var(--brand)) 45%, var(--line)); }
.kpi-go:hover .kgo { opacity: 1; color: var(--brand); transform: translateX(2px); }
.kpi-go:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kpi-go:active { transform: scale(.98); }
.kpi-go .label { padding-right: 26px; }

/* Novedades de Inicio (24/11) */
.nov-chips { margin: 2px 0 8px; }
.nov-item { cursor: pointer; align-items: center; border-radius: 10px; transition: background .15s var(--ease-out); }
.nov-item:hover { background: var(--brand-soft); }
.nov-ico { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.nov-item .sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nov-x { opacity: 0; transition: opacity .15s; }
.nov-item:hover .nov-x { opacity: 1; }
.nov-all { max-height: 60vh; overflow-y: auto; }
@media (hover: none) { .nov-x { opacity: 1; } }

/* 24/11 Ficha de cuenta: KPIs de Cuentas, ubicación, marcas, abono y líneas */
.kpis.kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.kpis-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis.kpis-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-go.on { border-color: var(--kpi-color, var(--brand)); box-shadow: 0 0 0 1px var(--kpi-color, var(--brand)) inset; }
.acc-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.acc-facts span { font-size: 12px; font-weight: 600; color: var(--ink); background: var(--brand-soft, rgba(31, 84, 217, .08)); border-radius: 999px; padding: 2px 9px; }
.inline-link { display: flex; gap: 6px; align-items: center; }
.inline-link input { flex: 1; min-width: 0; }
.inline-link .cbtn { white-space: nowrap; }
.brand-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.brand-checks .check { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0; font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.brand-checks .check input { width: auto; margin: 0; }
.brand-checks .check.multi { font-weight: 700; padding-right: 10px; border-right: 1px solid var(--line); }
.brand-checks .brand-other { width: 140px; padding: 4px 8px; font-size: 13px; }
.mini.bad { color: var(--red, #c0392b); font-weight: 600; }
.fee-hint { line-height: 1.4; }
.lines-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.lines-count { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lines-count .n { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--brand); }
.lines-count > span:nth-child(2) { font-weight: 700; }
.lines-table tr.off td { opacity: .55; }
.lines-table .ok { color: var(--green); font-weight: 700; }
/* 24/11 Borrar tareas */
.item .tdel { color: var(--muted); opacity: .55; flex: none; }
.item:hover .tdel, .item .tdel:focus-visible { opacity: 1; }
.item .tdel:hover { color: var(--danger, #c0392b); }
.item .tdel.sure { opacity: 1; color: #fff; background: var(--danger, #c0392b); border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 700; width: auto; }
@media (hover: none) { .item .tdel { opacity: .8; } }

/* 24/11 Cierre homogéneo: X arriba a la derecha en ventanas y fichas */
.xbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; padding: 0; transition: background-color .15s, color .15s, border-color .15s; }
.xbtn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.xbtn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.modal > .modal-x { position: absolute; top: 10px; right: 10px; z-index: 3; }
.modal > .modal-x + h2, .modal > .modal-x + * { padding-right: 36px; }
.modal.tr-modal > .modal-x { background: rgba(255,255,255,.7); }
.drawer-head { align-items: flex-start; }
.drawer-head > div:first-child { min-width: 0; flex: 1; }
.drawer-head h2 { overflow-wrap: anywhere; }
@media (max-width: 640px) { .modal > .modal-x { top: 6px; right: 6px; } }
/* Calendario: los nombres largos de calendarios no se salen del recuadro */
.cal-side { min-width: 0; overflow-wrap: anywhere; }
.cal-cal label:first-child { flex: 1; min-width: 0; }
.cal-cal label:first-child input { flex: none; }
.cal-cal label.mini { flex: none; white-space: nowrap; }
/* Botones de las ventanas: nunca se salen, bajan de renglón */
.modal .row-actions { flex-wrap: wrap; row-gap: 8px; }
.modal .row-actions .btn { white-space: nowrap; }
.modal .row-actions .check { white-space: nowrap; }
.modal:has(.tr-x) > .modal-x { display: none; }
.cal-cal .cal-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-side { overflow-wrap: normal; }

/* 24/11 Asistente con imagen propia o dibujo animado */
img.bot.bot-img { border-radius: 50%; object-fit: cover; display: inline-block; }
.bot-img-actions { margin-top: 8px; }
.ai-prev { display: grid; place-items: center; min-height: 0; }
.ai-prev img { border-radius: 24px; background: var(--surface-2); padding: 6px; }
#avMsg:empty { display: none; }

/* 25/11 Quick-Wins de varias semanas, responsables por estado */
.qw-span { font-size: 11.5px; color: var(--blue); margin-top: 3px; }
.state-owners { order: 9; grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.state-owners .mini { min-width: 0; overflow-wrap: anywhere; }

/* 25/11 Tablero DESARROLLO (como Trello) */
.tr-board { grid-auto-columns: minmax(272px, 272px); align-items: start; }
.tr-col { border-top: 1px solid var(--line); max-height: calc(100vh - 230px); min-height: 0; }
.tr-col header { padding: 8px 8px 6px 10px; gap: 6px; }
.tr-lname { flex: 1; min-width: 0; font: inherit; font-weight: 700; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; }
.tr-lname:focus { background: var(--surface); border-color: var(--blue); outline: none; }
.tr-card { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.tr-card b { font-weight: 600; overflow-wrap: anywhere; }
.tr-card.dragging { opacity: .45; }
.tr-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.tr-label { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 16px; padding: 1px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600; color: #172b4d; background: var(--lc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; }
.tr-label:empty { min-width: 40px; }
.tr-labels.big .tr-label { font-size: 13px; padding: 4px 10px; min-height: 26px; }
.tr-label button { border: 0; background: transparent; cursor: pointer; font-size: 14px; line-height: 1; color: inherit; padding: 0 0 0 2px; }
.tr-label.pick { cursor: pointer; }
.tr-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.tr-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); padding: 1px 4px; border-radius: 4px; }
.tr-badge.ok { background: #1f845a; color: #fff; }
.tr-badge.late { background: #c9372c; color: #fff; }
.tr-add { margin: 0 9px 9px; padding: 7px 8px; border: 0; background: transparent; color: var(--muted); text-align: left; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.tr-add:hover { background: var(--surface); color: var(--ink); }
.tr-newcard { margin: 0 9px 9px; display: flex; flex-direction: column; gap: 6px; }
.tr-newcard textarea { width: 100%; border: 1px solid var(--blue); border-radius: 8px; padding: 8px; font: inherit; background: var(--surface); color: var(--ink); resize: vertical; }
.tr-head { display: flex; flex-direction: column; gap: 4px; padding-right: 34px; }
.tr-title { font: inherit; font-size: 20px; font-weight: 700; color: var(--ink); border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; background: transparent; width: 100%; min-width: 0; }
.tr-title:focus { border-color: var(--blue); background: var(--surface); outline: none; }
.tr-inline { border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; background: var(--surface); color: var(--ink); font: inherit; max-width: 100%; }
.tr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; }
.tr-main, .tr-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tr-cl { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.tr-cl-h { display: flex; align-items: center; gap: 8px; }
.tr-cl-h input { flex: 1; min-width: 0; font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; background: transparent; color: var(--ink); }
.tr-cl-h input:focus { border-color: var(--blue); outline: none; }
.tr-ci { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 6px; }
.tr-ci:hover { background: var(--surface-2); }
.tr-ci span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tr-ci.done span { text-decoration: line-through; color: var(--muted); }
.tr-ci .iconbtn { opacity: .5; }
.tr-ci-add { display: flex; gap: 6px; }
.tr-ci-add input { flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; background: var(--surface); color: var(--ink); font: inherit; }
.tr-newcom { display: flex; gap: 8px; align-items: flex-start; }
.tr-newcom textarea { flex: 1; min-width: 0; }
.tr-coms { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.tr-com { display: flex; gap: 8px; align-items: flex-start; }
.tr-com-t { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 3px; font-size: 13px; }
.tr-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-swatches label { cursor: pointer; }
.tr-swatches input { display: none; }
.tr-swatches span { display: block; width: 34px; height: 22px; border-radius: 4px; outline: 2px solid transparent; outline-offset: 2px; }
.tr-swatches input:checked + span { outline-color: var(--blue); }
.linkbtn { border: 0; background: transparent; color: var(--blue); cursor: pointer; padding: 0; }
@media (max-width: 760px) { .tr-grid { grid-template-columns: 1fr; } .tr-board { grid-auto-columns: minmax(260px, 82vw); } }

/* 25/11 Bimo en 3 tamaños: normal, grande y pantalla completa */
.as-modes { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.as-modes .btn { border: 0; border-radius: 0; box-shadow: none; padding-inline: 8px; }
.as-modes .btn + .btn { border-left: 1px solid var(--line-2); }
.as-modes .btn.on { background: var(--brand-soft, var(--surface-2)); color: var(--brand-strong, var(--blue)); }
.app.as-full { grid-template-columns: var(--navw) minmax(0, 1fr); }
.app.as-full .assistant { grid-column: 2 / -1; }
.app.as-full .main { display: none; }
.app.as-full .assistant { border-left: 0; }
.app.as-full .as-resize { display: none; }
.app.as-full .as-head, .app.as-full .as-msgs, .app.as-full .as-suggest, .app.as-full .as-input { padding-left: max(16px, calc((100% - 920px) / 2)); padding-right: max(16px, calc((100% - 920px) / 2)); }
@media (max-width: 1100px) {
  .app.as-full { grid-template-columns: var(--navw) minmax(0, 1fr); }
  .app.as-full .assistant { left: var(--navw); width: auto; box-shadow: none; }
}
@media (max-width: 720px) {
  .app.as-full { grid-template-columns: minmax(0, 1fr); }
  .app.as-full .assistant { left: 0; width: 100%; }
}

/* 25/11 Ayuda: botón ?, instructivo, visita guiada y sugerencias */
.helpbtn { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; font-weight: 800; font-size: 15px; }
.help-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.help-tabs button { border: 0; background: transparent; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.help-tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
#helpBody { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.help-q input { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; background: var(--surface); color: var(--ink); font: inherit; }
.help-sec { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface); }
.help-sec h3 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.help-sec ul { margin: 4px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.sug-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-r input { display: none; }
.chip-r span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 99px; cursor: pointer; font-size: 13px; }
.chip-r input:checked + span { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); font-weight: 600; }
.tour { position: fixed; inset: 0; z-index: 200; }
.tour.no-hole { background: rgba(15, 27, 45, .55); }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(15, 27, 45, .55); outline: 2px solid #fff; transition: all .25s var(--ease-out); pointer-events: none; }
.tour-card { position: fixed; background: var(--surface); color: var(--ink); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; transition: left .25s var(--ease-out), top .25s var(--ease-out); }
.tour-card h3 { margin: 0; font-size: 16px; }
.tour-card p { margin: 0; font-size: 13.5px; color: var(--ink-2, var(--ink)); }
@media (max-width: 720px) { .userbox .helpbtn { width: 30px; height: 30px; } }

.sug-files { display: flex; flex-wrap: wrap; gap: 6px; }
.sug-files:empty { display: none; }
.sug-file { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 12.5px; background: var(--surface-2); overflow-wrap: anywhere; }
.sug-file button { border: 0; background: transparent; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); }

.qw-merge-list { max-height: 220px; overflow-y: auto; }

/* ---------- Visita guiada: salir en cualquier paso (25/11) ---------- */
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-exit { border: 1px solid var(--line-2); background: var(--surface-2, var(--surface)); color: var(--ink); border-radius: 99px; padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.tour-exit:hover { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }
.tour-bar { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.tour-bar span { display: block; height: 100%; background: var(--blue, #2d74e6); transition: width .25s; }

/* ---------- Instructivos (25/11) ---------- */
.guide-btn { margin-top: 6px; }
.hero .guide-btn, .head .guide-btn { display: inline-flex; }
.guide { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--surface); margin-bottom: 10px; }
.guide h3 { margin: 0 0 6px; font-size: 15.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.guide ol { margin: 0 0 4px; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; margin-top: 10px; }
.guide-grid .guide { margin: 0; }
.guide-video { max-width: 900px; }
.guide-video video { width: 100%; border-radius: 12px; background: #000; display: block; }
.manual-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.manual-toc a { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.manual-toc a:hover { border-color: var(--blue); }
.manual { max-width: 820px; line-height: 1.55; }
.manual h2 { font-size: 24px; margin: 6px 0 8px; }
.manual h3 { margin: 26px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--blue-soft, var(--line)); scroll-margin-top: 80px; }
.manual h4 { margin: 16px 0 4px; font-size: 15.5px; }
.manual ul, .manual ol { padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.manual .man-hit { background: var(--pending-soft, #fff4d6); border-radius: 8px; outline: 6px solid var(--pending-soft, #fff4d6); }

/* ---------- Reglas (25/11) ---------- */
.rule-group { margin-top: 12px; }
.rule-group h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.rule { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; flex-wrap: wrap; }
.rule .grow { flex: 1 1 300px; }
.rule.off { opacity: .6; }
.rule-kind { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }

/* ---------- Quick-Wins: actualizar con hoja de ruta nueva (25/11) ---------- */
.rp-item.rp-upd { border-left: 3px solid var(--blue, #2d74e6); }
.rp-item.rp-close { border-left: 3px solid #00a36c; }
.rp-item.rp-new { border-left: 3px solid #b26a00; }
.rp-item.rp-same { opacity: .55; }
.ru-changes { margin: 4px 0 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.ru-changes s { color: var(--muted); }

/* ---------- Discord en ambos sentidos: hilos, responder (25/11) ---------- */
.dc-list { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 8px; }
.dc-threads { display: none; margin: 0 0 4px 18px; border-left: 1px solid #3f4147; }
.dc-threads.open { display: block; }
.dc-th { display: block; width: calc(100% - 12px); margin: 1px 6px; text-align: left; font: inherit; font-size: 13px; color: #949ba4; background: transparent; border: 0; border-radius: 4px; padding: 4px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-th:hover { background: #35373c; color: #dbdee1; } .dc-th.on { background: #404249; color: #f2f3f5; }
.dc-threads:not(.all) .dc-th.more { display: none; }
.dc-showmore { color: #00a8fc; font-size: 12px; }
.dc-msg { position: relative; } .dc-msg .grow { flex: 1; min-width: 0; }
.dc-tools { position: absolute; right: 16px; top: 2px; display: none; gap: 2px; background: #2b2d31; border: 1px solid #1f2023; border-radius: 6px; padding: 2px; }
.dc-msg:hover .dc-tools { display: flex; }
.dc-tools button, .dc-tools a { background: transparent; border: 0; color: #b5bac1; cursor: pointer; font-size: 14px; padding: 2px 7px; text-decoration: none; border-radius: 4px; }
.dc-tools button:hover, .dc-tools a:hover { background: #404249; color: #f2f3f5; }
.dc-thread { color: #00a8fc; text-decoration: none; } .dc-thread:hover { text-decoration: underline; }
.dc-replying { font-size: 12.5px; color: #b5bac1; background: #2b2d31; border-radius: 8px 8px 0 0; padding: 6px 12px; display: flex; gap: 6px; align-items: center; }
.dc-replying button { margin-left: auto; background: transparent; border: 0; color: #b5bac1; cursor: pointer; }
.rp-item.rp-gone { border-left: 3px solid #c0392b; }
.qw-hist ol { margin: 4px 0 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
