/* Mesa de Ayuda + Proyectos — estilos */
:root {
  --brand: #C8102E;
  --accent: #F2A900;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --line: #e4e7ec;
  --line-2: #eef0f3;
  --text: #141821;
  --text-2: #3b4250;
  --muted: #6b7280;
  --rail: #171b26;
  --rail-2: #232838;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --info: #2563eb;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --brand-soft: color-mix(in srgb, var(--brand) 10%, white);
  --font: Montserrat, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
h4 { font-size: 13px; font-weight: 600; margin: 14px 0 8px; color: var(--text-2); }
p { margin: 0 0 8px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
.ic { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.danger-text { color: var(--danger) !important; }
.warn-text { color: var(--warn); }
.done-text { text-decoration: line-through; color: var(--muted); }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: 100%; vertical-align: middle; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; }
.row.gap, .gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clickable { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Marca: isotipo y barras inclinadas (negro, rojo, amarillo) ---------- */
.slash { display: inline-flex; gap: 4px; transform: skewX(-18deg); }
.slash i { width: 5px; height: 20px; background: var(--brand); }
.slash i:first-child { background: #1a1a1a; }
.slash i:nth-child(3) { background: var(--accent); }
.slash i:nth-child(4) { display: none; }
.slash.big i { width: 8px; height: 34px; }
.boot { height: 100vh; display: grid; place-items: center; }
.boot .slash, .boot-iso { animation: pulse 1.2s ease-in-out infinite; }
.rail-iso { display: grid; place-items: center; width: 44px; height: 44px; background: #fff; border-radius: 10px; }
.rail-iso img { width: 32px; height: auto; background: none; padding: 0; border-radius: 0; max-width: none; }
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.auth-logo img { flex: none; }
.auth-logo b { display: block; font-size: 25px; font-weight: 800; letter-spacing: .01em; line-height: 1; color: #000; }
.auth-logo small { display: block; font-size: 14px; color: #3b4250; margin-top: 3px; }
.auth-logo.custom img { max-height: 56px; max-width: 220px; }
.auth-product { border-top: 3px solid var(--brand); margin: 14px 0 20px; padding-top: 12px; }
.auth-product b { display: block; font-size: 18px; font-weight: 700; }
.auth-product small { color: var(--muted); }
.logo-prev img { max-width: 48px; }
@keyframes pulse { 50% { opacity: .4; } }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; width: 72px; flex: none; background: var(--rail); display: flex; flex-direction: column; align-items: stretch; padding: 10px 6px; gap: 2px; z-index: 30; }
.rail a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border-radius: 8px; color: #a7adbd; font-size: 10.5px; font-weight: 500; }
.rail a:hover { background: var(--rail-2); color: #fff; }
.rail a.active { background: var(--rail-2); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.rail a.active .ic { color: #fff; }
.rail-logo { height: 52px; justify-content: center; margin-bottom: 8px; }
.rail-logo img { max-width: 40px; max-height: 40px; border-radius: 6px; background: #fff; padding: 2px; }
.rail-logo .slash i { background: #fff; }
.rail-logo .slash i:last-child { background: var(--accent); }
.rail-space { flex: 1; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs span:last-child { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: #c3c8d2; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.gsearch { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; height: 36px; width: 300px; color: var(--muted); }
.gsearch input { border: 0; outline: 0; background: transparent; flex: 1; font: inherit; color: var(--text); min-width: 0; }
.gsearch:focus-within { border-color: var(--brand); background: #fff; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.me-btn { border: 0; background: none; padding: 0; border-radius: 50%; }
.view { flex: 1; min-width: 0; }
.page { padding: 22px 24px 40px; max-width: 1400px; margin: 0 auto; }
.page.narrow { max-width: 860px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.loading { display: grid; place-items: center; padding: 60px 0; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mobile-only { display: none !important; }
.banner { background: #fff7e6; border-bottom: 1px solid #fde3a7; padding: 8px 16px; font-size: 13px; display: flex; gap: 10px; align-items: center; }

/* ---------- Botones e inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; font-size: 13px; color: var(--text-2); white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--panel-2); border-color: #d0d5dd; color: var(--text); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(.94); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--danger); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.active { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, white); color: var(--brand); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .pill { background: var(--brand); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; border: 0; background: transparent; color: var(--text-2); }
.icon-btn:hover { background: var(--line-2); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.link-btn { border: 0; background: none; color: var(--brand); font-size: 12px; font-weight: 500; padding: 0; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; font: inherit; background: #fff; color: var(--text); outline: none; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
select.input[multiple] { height: auto; padding: 4px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.input.sm { height: 30px; font-size: 13px; padding: 0 8px; }
.input.big { height: 44px; font-size: 18px; font-weight: 600; }
.input[type=color] { padding: 2px; width: 60px; }
.input:disabled { background: var(--panel-2); color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 500; color: var(--text-2); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; cursor: pointer; }
.check.sm { font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid2.tight { gap: 0 10px; }
.form-error { color: var(--danger); font-size: 13px; background: #fef2f2; border: 1px solid #fecaca; padding: 8px 10px; border-radius: 6px; }
.callout { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.callout.warn { background: #fff7e6; border: 1px solid #fde3a7; }

/* ---------- Tarjetas, KPIs ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sec-head h3, .sec-head h4 { margin: 0; }
.sec-head select { width: auto; max-width: 50%; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
a.kpi:hover { border-color: var(--brand); color: inherit; }
.kpi span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi b { font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--info); }
.kpi.danger b { color: var(--danger); }
.kpi.warn b { color: var(--warn); }
.kpi.ok b { color: var(--ok); }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid > .card { margin: 0; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.perf { display: grid; gap: 14px; }
.perf div { display: flex; flex-direction: column; }
.perf span { color: var(--muted); font-size: 12px; }
.perf b { font-size: 24px; font-weight: 700; }
.perf small { color: var(--muted); font-size: 11px; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 3px; }
.seg a { padding: 5px 12px; border-radius: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.seg a.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* ---------- Gráficos ---------- */
.hbars { display: flex; flex-direction: column; gap: 7px; }
.hb-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.hb-track { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.hb-bar { display: block; height: 100%; border-radius: 4px; }
.hb-val { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line-2); }
.chart .axis { fill: var(--muted); font-size: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line-2); }
.stack span { display: block; height: 100%; }
.progress { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; display: block; }
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.progress.thin { height: 4px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.card .table-wrap { border: 0; border-radius: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: #fafbfc; }
.tbl tr.sel { background: var(--brand-soft) !important; }
.tbl tr.inactive td { color: var(--muted); }
.tbl.compact td, .tbl.compact th { padding: 7px 8px; }
.tbl.num td:not(:first-child), .tbl.num th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl .cb { width: 34px; }
.ellip-cell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-tbl td { padding: 5px 6px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; color: var(--c, #475569); background: color-mix(in srgb, var(--c, #475569) 12%, white); white-space: nowrap; }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.prio i, .dotc { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--line-2); color: var(--text-2); margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12px; max-width: 100%; }
.chip small { color: var(--muted); }
.chip button { border: 0; background: none; padding: 0; color: var(--muted); display: inline-flex; }
.chip.sm { padding: 1px 6px; font-size: 11px; }
.sla { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; padding: 1px 6px; border-radius: 4px; }
.sla.late { background: #fef2f2; color: var(--danger); }
.sla.warn { background: #fff7e6; color: var(--warn); }
.sla.fine { background: #eff6ff; color: var(--info); }
.sla.ok { background: #ecfdf5; color: var(--ok); }
.sla.none { color: var(--muted); }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; letter-spacing: .02em; }
.avatar.none { background: var(--line-2); color: var(--muted); border: 1px dashed #c3c8d2; }
.avatar.contact { background: #64748b; }
.avatars { display: inline-flex; }
.avatars .avatar { margin-left: -6px; border: 2px solid #fff; }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------- Modal, popover, toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 28, .48); display: grid; place-items: start center; padding: 6vh 16px 16px; z-index: 100; overflow: auto; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); animation: rise .15s ease-out; }
.modal.wide { max-width: 860px; }
.modal.xl { max-width: 1100px; }
@keyframes rise { from { transform: translateY(8px); opacity: .6; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 20px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 10px 20px 16px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-2); background: var(--panel-2); border-radius: 0 0 12px 12px; }
.confirm-text { font-size: 14px; }
.popover { position: fixed; z-index: 120; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; max-width: 360px; animation: fade .1s; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 6px; font-size: 13px; text-align: left; color: var(--text-2); }
.menu-item:hover { background: var(--line-2); color: var(--text); }
.menu-item.on { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.menu-item.danger { color: var(--danger); }
.menu-scroll { max-height: 320px; overflow: auto; }
.menu-filter { padding: 4px 4px 6px; }
.menu-head { display: flex; gap: 10px; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.menu-head small { display: block; color: var(--muted); }
.search-results { width: 340px; max-height: 360px; overflow: auto; }
.notif-pop { width: 360px; padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.notif-list { max-height: 420px; overflow: auto; }
.notif { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.notif span { color: var(--text-2); font-size: 12px; }
.notif small { color: var(--muted); font-size: 11px; }
.notif.unread { background: color-mix(in srgb, var(--brand) 5%, white); box-shadow: inset 3px 0 0 var(--brand); }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { display: flex; align-items: center; gap: 8px; background: #1f2433; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13px; transition: opacity .4s, transform .4s; max-width: 90vw; }
.toast.ok .ic { color: #34d399; }
.toast.error { background: #7f1d1d; }
.toast.out { opacity: 0; transform: translateY(8px); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { color: #c3c8d2; margin-bottom: 8px; }
.empty h4 { color: var(--text); font-size: 15px; margin: 4px 0; }
.empty .btn { margin-top: 10px; }

/* ---------- Lista de tickets ---------- */
.tickets-view { display: flex; height: calc(100vh - 56px); }
.views-panel { width: 250px; flex: none; background: var(--panel); border-right: 1px solid var(--line); overflow: auto; transition: width .15s; }
.views-panel.collapsed { width: 0; border: 0; overflow: hidden; }
.vp-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 8px 14px; }
.vp-list { display: flex; flex-direction: column; padding: 0 6px 16px; }
.vp-list a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 6px; font-size: 13px; color: var(--text-2); }
.vp-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-list a b { font-weight: 500; color: var(--muted); font-size: 12px; }
.vp-list a:hover { background: var(--line-2); color: var(--text); }
.vp-list a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.vp-list a.active b { color: var(--brand); }
.vp-sub { display: flex; justify-content: space-between; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 16px 4px 4px 10px; }
.list-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar.flat { background: none; border: 0; padding: 0 0 12px; }
.sortsel { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sortsel select { width: auto; }
.searchbox { display: flex; align-items: center; gap: 6px; height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; background: #fff; color: var(--muted); min-width: 220px; }
.searchbox input { border: 0; outline: 0; flex: 1; font: inherit; font-size: 13px; color: var(--text); min-width: 0; background: transparent; }
.searchbox:focus-within { border-color: var(--brand); }
.bulk { display: flex; align-items: center; gap: 8px; background: var(--brand-soft); padding: 3px 4px 3px 10px; border-radius: 8px; font-size: 12px; color: var(--brand); font-weight: 500; }
.pager { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.list-area .table-wrap { flex: 1; border: 0; border-radius: 0; }
.tickets-tbl td { white-space: nowrap; }
.tickets-tbl td.subj { white-space: normal; min-width: 280px; max-width: 520px; }
.tickets-tbl td.subj a { font-weight: 500; color: var(--text); display: block; }
.tickets-tbl td.subj a:hover { color: var(--brand); }
.tickets-tbl td.subj b { color: var(--info); font-weight: 600; }
.tickets-tbl .sub { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.tickets-tbl td .ellip { max-width: 180px; }
.tickets-tbl td.ch { color: var(--muted); width: 44px; text-align: center; }
.tickets-tbl tbody tr { cursor: pointer; }
.cell-edit { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: none; border-radius: 6px; padding: 2px 4px; max-width: 200px; }
.cell-edit .ic:last-child { color: #b8bec9; }
.cell-edit:hover { border-color: var(--line); background: #fff; }

/* ---------- Detalle de ticket ---------- */
.ticket-view { padding: 0; }
.tk-actions { position: sticky; top: 56px; z-index: 10; display: flex; gap: 8px; align-items: center; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; padding: 18px; max-width: 1500px; margin: 0 auto; }
.tk-main { min-width: 0; }
.tk-head { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.tk-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.tk-subject { font-size: 19px; cursor: text; border-radius: 6px; padding: 2px 4px; margin: -2px -4px 6px; }
.tk-subject:hover { background: var(--line-2); }
.tk-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); align-items: center; }
.tk-meta span { display: inline-flex; align-items: center; gap: 5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; }
.tabs button { border: 0; background: none; padding: 9px 12px; font-size: 13px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tabs button b { font-weight: 600; font-size: 11px; background: var(--line-2); border-radius: 8px; padding: 0 6px; color: var(--text-2); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.msg.reply { border-left: 3px solid var(--info); }
.msg.note { background: #fffbeb; border-color: #fde68a; border-left: 3px solid var(--warn); }
.msg.forward { border-left: 3px solid #7c3aed; }
.msg.customer { border-left: 3px solid #94a3b8; }
.msg-body { flex: 1; min-width: 0; }
.msg-body header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.msg-body time { margin-left: auto; font-size: 12px; color: var(--muted); }
.msg-kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--line-2); padding: 1px 6px; border-radius: 4px; }
.msg.note .msg-kind { background: #fde68a; color: #92400e; }
.msg-html { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; overflow-x: auto; }
.msg-html p { margin: 0 0 8px; }
.msg-html img { max-width: 100%; height: auto; }
.msg-html blockquote { border-left: 3px solid var(--line); margin: 6px 0; padding-left: 10px; color: var(--muted); }
.msg-html pre { background: var(--line-2); padding: 8px; border-radius: 6px; overflow: auto; }
.msg-html table { border-collapse: collapse; }
.msg-html td, .msg-html th { border: 1px solid var(--line); padding: 4px 6px; }
.atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity > li { display: flex; gap: 12px; padding: 8px 0; font-size: 13px; position: relative; }
.activity > li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 22px; bottom: -6px; width: 2px; background: var(--line-2); }
.act-dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd2dc; margin-top: 4px; flex: none; }
.activity time { display: block; font-size: 11.5px; color: var(--muted); }
.activity ul { margin: 4px 0 0; padding-left: 16px; color: var(--text-2); font-size: 12.5px; }
.composer { background: var(--panel); border: 1px solid var(--brand); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent); }
.composer.note { border-color: var(--warn); box-shadow: 0 0 0 3px #fef3c7; background: #fffdf5; }
.composer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.composer-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.composer-foot label { display: inline-flex; align-items: center; gap: 6px; }
.composer-foot select { width: auto; }
.tk-side .card { padding: 14px; }
.tk-side h3 { font-size: 13px; }
.tk-side h4 { margin-top: 12px; }
.props .field { margin-bottom: 9px; }
.props .field > span { font-size: 11.5px; color: var(--muted); }
.contact-card { display: flex; flex-direction: column; gap: 3px; font-size: 13px; margin-bottom: 8px; }
.mini-list { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; }
.mini-list li { padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; display: flex; flex-direction: column; gap: 1px; }
.mini-list li.row { flex-direction: row; align-items: center; gap: 8px; }
.mini-list li.row > :first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list small { color: var(--muted); font-size: 11.5px; }
.mini-list li:last-child { border: 0; }
.time-form { margin-top: 6px; }
.time-form input[name=minutes] { width: 76px; flex: none; }
.small-info { display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; }
.small-info div { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.small-info span { color: var(--muted); }
.small-info b { font-weight: 500; text-align: right; display: inline-flex; }
.st-todo { color: #475569; }
.st-doing { color: var(--info); }
.st-done { color: var(--ok); }
.st-open { color: var(--info); }
.st-pending { color: var(--warn); }
.st-resolved { color: var(--ok); }

/* ---------- Editor ---------- */
.rte { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.rte:focus-within { border-color: var(--brand); }
.rte-bar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.rte-bar button, .rte-attach { border: 0; background: none; min-width: 28px; height: 26px; border-radius: 5px; font-size: 13px; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; }
.rte-bar button:hover, .rte-attach:hover { background: var(--line-2); }
.rte-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.rte-area { padding: 10px 12px; outline: none; font-size: 14px; overflow-wrap: anywhere; max-height: 480px; overflow: auto; }
.rte-area:empty::before { content: attr(data-placeholder); color: #9aa1ad; white-space: pre-line; }
.rte-area p { margin: 0 0 6px; }
.rte-area blockquote { border-left: 3px solid var(--line); margin: 4px 0; padding-left: 10px; color: var(--muted); }
.rte-area pre { background: var(--line-2); padding: 6px 8px; border-radius: 6px; }
.rte-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px; }
.rte-files:not(:empty) { padding: 0 8px 8px; }

/* ---------- Proyectos ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.proj-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
.proj-card:hover { border-color: #c9ced8; transform: translateY(-1px); color: inherit; }
.proj-card.archived { opacity: .65; }
.proj-card h3 { margin: 0; font-size: 15px; }
.proj-top, .proj-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.proj-key { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .03em; }
.proj-key.sm { min-width: 0; height: 20px; font-size: 10.5px; padding: 0 5px; }
.project-view { display: flex; flex-direction: column; }
.proj-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 8px; background: var(--panel); flex-wrap: wrap; }
.proj-head h1 { font-size: 19px; }
.proj-tabs { display: flex; gap: 2px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.proj-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: 13px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.proj-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.proj-body { padding: 16px 20px 40px; }
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.pfilters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pfilters select { width: auto; }
.avatar-filter { display: inline-flex; }
.avatar-filter button { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 2px solid #fff; background: #fff; padding: 0; margin-left: -6px; border-radius: 50%; transition: transform .1s; }
.avatar-filter button:first-child { margin-left: 0; }
.avatar-filter button:hover { transform: translateY(-2px); z-index: 1; }
.avatar-filter button.on { box-shadow: 0 0 0 2px var(--brand); z-index: 2; }
.board { display: grid; grid-template-columns: repeat(var(--cols), minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.bcol { background: #ebedf0; border-radius: 10px; display: flex; flex-direction: column; min-height: 200px; }
.bcol.over-wip { background: #fde8e8; }
.bcol-head { display: flex; justify-content: space-between; padding: 10px 12px 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.bcol-head b { color: var(--muted); font-weight: 600; }
.bcol-body { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; flex: 1; border-radius: 8px; transition: background .1s; }
.bcol-body.drop-over { background: rgba(37, 99, 235, .08); }
.drop-empty { min-height: 24px; flex: 1; }
.bcol-add { border: 0; background: none; text-align: left; padding: 8px 12px 10px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; border-radius: 0 0 10px 10px; }
.bcol-add:hover { background: rgba(0, 0, 0, .04); color: var(--text); }
.kcard { background: #fff; border-radius: 8px; padding: 10px 10px 8px; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); cursor: grab; display: flex; flex-direction: column; gap: 6px; border: 1px solid transparent; }
.kcard:hover { border-color: #c9ced8; }
.kcard.dragging { opacity: .45; }
.kc-title { font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.kc-labels { display: flex; flex-wrap: wrap; gap: 3px; }
.kc-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.kc-key { font-weight: 600; color: var(--muted); font-size: 11.5px; }
.kc-sub { color: var(--muted); display: inline-flex; align-items: center; gap: 2px; font-size: 11px; }
.kc-due { font-size: 11px; color: var(--muted); background: var(--line-2); padding: 0 5px; border-radius: 4px; }
.kc-due.late { background: #fef2f2; color: var(--danger); }
.epic-chip { align-self: flex-start; font-size: 11px; font-weight: 600; color: #6d28d9; background: #ede9fe; padding: 1px 7px; border-radius: 4px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-ic { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 4px; color: #fff; flex: none; }
.type-ic .ic { stroke-width: 2.6; }
.prio-ic { display: inline-flex; }
.pts { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--line-2); font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; color: var(--text-2); }
.pts.empty { color: #b8bec9; }
.st-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.st-pill.st-todo { background: #e5e7eb; color: #374151; }
.st-pill.st-doing { background: #dbeafe; color: #1d4ed8; }
.st-pill.st-done { background: #d1fae5; color: #047857; }
.backlog { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.epic-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; align-self: start; position: sticky; top: 72px; }
.epic-item { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 6px; font-size: 13px; }
.epic-item small { color: var(--muted); font-size: 11px; }
.epic-item:hover { background: var(--line-2); }
.epic-item.on { background: #ede9fe; color: #5b21b6; }
.bl-section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.bl-section.active { border-color: color-mix(in srgb, var(--info) 40%, white); }
.bl-section > header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.bl-section > header .grow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bl-section > footer { padding: 6px 12px 8px; text-align: right; }
.bl-list { min-height: 40px; padding: 4px 0; transition: background .1s; }
.bl-list.drop-over { background: rgba(37, 99, 235, .06); }
.bl-list .drop-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 8px; min-height: 20px; }
.bl-list .drop-empty:empty { padding: 0; min-height: 8px; }
.bl-row { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line-2); cursor: grab; font-size: 13px; background: #fff; }
.bl-row:hover { background: #fafbfc; }
.bl-row.dragging { opacity: .4; }
.bl-row .grip { color: #c3c8d2; display: inline-flex; }
.bl-key { font-weight: 600; color: var(--muted); font-size: 12px; white-space: nowrap; }
.bl-title { flex: 1; min-width: 0; }
.pts-sum { display: inline-flex; gap: 3px; }
.pts-sum i { font-style: normal; font-size: 11px; font-weight: 600; min-width: 22px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 6px; }
.pts-sum .todo { background: #e5e7eb; }
.pts-sum .doing { background: #dbeafe; color: #1d4ed8; }
.pts-sum .done { background: #d1fae5; color: #047857; }
.quick-add { display: flex; gap: 6px; padding: 8px 12px 0; }
.quick-add select { width: 110px; flex: none; }
.list-opts { margin-bottom: 10px; }
.roadmap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rm-head, .rm-row { display: grid; grid-template-columns: 260px 1fr; }
.rm-head { background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--muted); font-weight: 600; }
.rm-label { padding: 10px 12px; border-right: 1px solid var(--line); display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; }
.rm-label small { margin-left: auto; }
.rm-track { position: relative; min-height: 40px; }
.rm-head .rm-track span { position: absolute; top: 10px; transform: translateX(4px); white-space: nowrap; text-transform: capitalize; }
.rm-head .rm-track span::before { content: ""; position: absolute; left: -4px; top: -10px; bottom: -14px; border-left: 1px solid var(--line); }
.rm-row { border-bottom: 1px solid var(--line-2); cursor: pointer; }
.rm-row:hover { background: #fafbfc; }
.rm-bar { position: absolute; top: 11px; height: 18px; border-radius: 5px; background: #ddd6fe; overflow: hidden; border: 1px solid #c4b5fd; }
.rm-bar span { display: block; height: 100%; background: #8b5cf6; }
.rm-bar.done { background: #d1fae5; border-color: #6ee7b7; }
.rm-bar.done span { background: #10b981; }
.rm-track .today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--brand); opacity: .5; }
.rm-nodate { position: absolute; left: 12px; top: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-grid .card { margin: 0; }
.wf { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.wf-row { display: flex; gap: 6px; align-items: center; }
.wf-row select { width: 130px; }
.wf-move { display: flex; flex-direction: column; }
.wf-move .icon-btn { height: 15px; }
.danger-zone { border-color: #fecaca; }

/* ---------- Issue ---------- */
.issue-modal { padding: 0 !important; }
.issue-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line-2); gap: 10px; }
.crumbline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.crumbline a, .crumbline span { display: inline-flex; align-items: center; gap: 5px; }
.crumbline .sep { color: #c3c8d2; }
.issue-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; padding: 14px 18px 20px; }
.issue-page .issue-grid { padding: 14px 0 0; }
.issue-page { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px 18px !important; margin-top: 18px; }
.issue-page .issue-top { padding: 12px 0; }
.issue-title { width: 100%; border: 1px solid transparent; border-radius: 6px; font: inherit; font-size: 21px; font-weight: 650; padding: 4px 6px; margin: 0 0 10px -6px; resize: none; overflow: hidden; outline: none; color: var(--text); background: transparent; }
.issue-title:hover { background: var(--line-2); }
.issue-title:focus { border-color: var(--brand); background: #fff; }
.issue-section { margin-bottom: 18px; }
.issue-section .sec-head { margin-bottom: 6px; }
.desc { font-size: 14px; color: var(--text-2); padding: 6px; margin: 0 -6px; border-radius: 6px; cursor: text; overflow-wrap: anywhere; }
.desc:hover { background: var(--panel-2); }
.desc.empty-desc { color: #9aa1ad; }
.desc p { margin: 0 0 8px; }
.child-list { list-style: none; margin: 6px 0; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; }
.child-list:empty { display: none; }
.child-list li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line-2); font-size: 13px; cursor: pointer; }
.child-list li:last-child { border-bottom: 0; }
.child-list li:hover { background: #fafbfc; }
.link-kind { min-width: 120px; }
.issue-side { display: flex; flex-direction: column; }
.issue-side .field { margin-bottom: 10px; }
.issue-side .field > span { font-size: 11.5px; color: var(--muted); }
.ro { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 0; }
.status-select { font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .03em; }
.status-select.st-todo { background: #e5e7eb; }
.status-select.st-doing { background: #dbeafe; color: #1d4ed8; }
.status-select.st-done { background: #d1fae5; color: #047857; }
.side-dates { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); margin-top: 8px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.comment-new { display: flex; gap: 10px; margin-bottom: 14px; }
.comment-new .row { margin-top: 6px; }
.comments { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment header { display: flex; gap: 8px; align-items: baseline; font-size: 13px; margin-bottom: 2px; }
.comment time { color: var(--muted); font-size: 12px; }

/* ---------- Mi trabajo ---------- */
.work-list { list-style: none; margin: 0; padding: 0; }
.work-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-2); font-size: 13px; align-items: center; flex-wrap: wrap; }
.work-list li.clickable:hover { background: #fafbfc; }
.work-list li > :first-child { min-width: 0; flex: 1; }
.grp-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 4px; }
.grp-title small { font-weight: 500; }

/* ---------- KB, configuración ---------- */
.kb-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.kb-cats { display: flex; flex-direction: column; gap: 2px; padding: 12px; }
.kb-cats a { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 6px; font-size: 13px; flex: 1; }
.kb-cats a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.kb-cat-row { display: flex; align-items: center; }
.settings { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 72px; }
.settings-nav a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; font-size: 13.5px; color: var(--text-2); }
.settings-nav a:hover { background: var(--line-2); }
.settings-nav a.on { background: var(--panel); color: var(--brand); font-weight: 600; box-shadow: var(--shadow); }
.logo-prev { width: 56px; height: 56px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: var(--panel-2); }
.logo-prev img { max-width: 100%; max-height: 100%; }
.sla-card { border: 1px solid var(--line-2); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.sla-card .tbl { max-width: 480px; margin: 10px 0; }
.rule-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.rule-row select, .rule-row input { flex: 1; }
.copybox { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 6px 6px 10px; margin: 6px 0 10px; }
.copybox code { background: none; flex: 1; overflow: auto; white-space: nowrap; font-size: 12.5px; }
.steps { padding-left: 18px; font-size: 13px; color: var(--text-2); }
.steps li { margin-bottom: 6px; }

/* ---------- Login / instalación ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand) 12%, transparent), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card.wide { max-width: 640px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth-brand b { display: block; font-size: 18px; }
.auth-brand small { color: var(--muted); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.ms { height: 40px; }
.center-box { max-width: 480px; margin: 20vh auto; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span3 { grid-column: 1 / -1; }
  .tk-grid { grid-template-columns: minmax(0, 1fr); }
  .issue-grid { grid-template-columns: minmax(0, 1fr); }
  .gsearch { width: 200px; }
}
@media (max-width: 760px) {
  .rail { position: fixed; left: -80px; transition: left .2s; }
  .layout.rail-open .rail { left: 0; box-shadow: var(--shadow-lg); }
  .mobile-only { display: inline-grid !important; }
  .gsearch, .btn#btnNew span { display: none; }
  .page { padding: 16px; }
  .dash-grid, .dash-grid.two, .settings-grid, .backlog, .kb-layout, .settings { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .tickets-view { height: auto; flex-direction: column; }
  .views-panel { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
  .epic-panel, .settings-nav { position: static; }
  .rm-head, .rm-row { grid-template-columns: 140px 1fr; }
  .board { grid-template-columns: repeat(var(--cols), 260px); }
  .tk-grid, .proj-body { padding: 12px; }
  .searchbox { min-width: 0; flex: 1; }
}
@media print {
  .rail, .topbar, .tk-actions, .tk-side, .composer-slot, .tabs { display: none !important; }
  .tk-grid { display: block; padding: 0; }
  body { background: #fff; }
}

/* ---------- Superadmin ---------- */
.super-badge { --c: #111827; background: #111827; color: #fff; margin-top: 4px; }
.super-card { border-color: #111827; border-left: 4px solid #111827; }
.super-row td { background: #f8fafc; }
.flag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.flag-list li { display: flex; align-items: center; gap: 6px; }
.ok-text { color: var(--ok); display: inline-flex; }
.maint { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.maint > div { border: 1px solid var(--line-2); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.maint p { margin: 0 0 6px; }
.inline-num { width: 60px; display: inline-block; height: 24px; }
.warn-row td { background: #fff7ed; }
@media (max-width: 760px) { .maint { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Ticket convertido en proyecto: fases ---------- */
.dev-card { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.dev-card > header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.dev-card > header small { display: block; font-size: 12px; }
.dev-card .proj-key { flex: none; }
.dev-card > footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.dev-progress { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.dev-progress .progress { flex: 1; height: 8px; }
.dev-pct { font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; counter-reset: ph; }
.ph { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 0 4px; min-width: 0; }
.ph::before { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.ph:first-child::before { display: none; }
.ph.done::before, .ph.active::before { background: var(--ok); }
.ph-dot { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 3px solid var(--line); color: #fff; }
.ph.done .ph-dot { background: var(--ok); border-color: var(--ok); }
.ph.active .ph-dot { border-color: var(--info); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--info); animation: pulse 1.4s ease-in-out infinite; }
.ph-name { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.25; overflow-wrap: anywhere; }
.ph.pending .ph-name { color: var(--muted); font-weight: 500; }
.ph-meta { font-size: 11px; color: var(--muted); }
.ph.active .ph-meta { color: var(--info); font-weight: 600; }
.phase-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.phase-row input[type=date] { width: 150px; flex: none; }
.ph-num { width: 22px; height: 22px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.proj-chip { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 30%, white); background: var(--brand-soft); font-weight: 600; }
.proj-head .origin { margin-top: 4px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.proj-head .origin a { color: var(--info); }
.portal-dev { margin: 14px 0; }
@media (max-width: 760px) {
  .phases { grid-auto-flow: row; grid-auto-columns: auto; gap: 10px; }
  .ph { flex-direction: row; text-align: left; gap: 10px; }
  .ph::before { display: none; }
  .phase-row { flex-wrap: wrap; }
}
.rule-info { display: flex; gap: 8px; align-items: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--text-2); }
.rule-info .ic { color: var(--accent); margin-top: 1px; }
.rule-info a { color: var(--brand); font-weight: 500; }
.phase-rules .rule-row input { flex: 1.2; }

/* ---------- v1.4: tablero del agente ---------- */
.block { display: block; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 6px; }
.spinner.sm { width: 13px; height: 13px; border-width: 2px; display: inline-block; vertical-align: -2px; }
.kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi.muted b { color: var(--text-2); }
div.kpi { cursor: default; }
.alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid; background: var(--panel); }
.alert div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert b { font-size: 14px; }
.alert span { font-size: 12.5px; color: var(--text-2); }
.alert .ic { margin-top: 1px; }
.alert.critical { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.warn { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
a.alert:hover { filter: brightness(.98); color: inherit; }
.age-hist { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; height: 190px; align-items: end; padding-top: 6px; }
.age-col { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 6px; height: 100%; text-align: center; }
.age-col b { font-size: 16px; font-variant-numeric: tabular-nums; }
.age-col .bar { display: block; border-radius: 6px 6px 2px 2px; background: var(--c); min-height: 2px; max-height: calc(100% - 52px); }
.age-col small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.age-col.ok { --c: #10b981; } .age-col.warn { --c: #f59e0b; } .age-col.danger { --c: #ef4444; } .age-col.critical { --c: #991b1b; }
.age { display: inline-block; white-space: nowrap; min-width: 46px; text-align: center; padding: 2px 8px; border-radius: 11px; font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.age.ok { background: #ecfdf5; color: #047857; } .age.warn { background: #fffbeb; color: #b45309; } .age.danger { background: #fef2f2; color: #b91c1c; } .age.critical { background: #991b1b; color: #fff; }
.tbl .r, .tbl th.r { text-align: right; }
.tbl.aging td { vertical-align: top; }
.imp-list { list-style: none; margin: 0; padding: 0; }
.imp-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.imp-list li:last-child { border: 0; }
.score { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.score.danger { background: #fef2f2; color: #b91c1c; } .score.warn { background: #fff7ed; color: #c2410c; } .score.info { background: #eff6ff; color: #1d4ed8; }
.reasons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.rchip { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--line-2); color: var(--text-2); }
.rchip.danger { background: #fef2f2; color: #b91c1c; } .rchip.warn { background: #fffbeb; color: #b45309; } .rchip.info { background: #eff6ff; color: #1d4ed8; }
.sec-title { margin: 8px 0 12px; font-size: 15px; color: var(--text-2); }

/* ---------- v1.4: IA en el ticket ---------- */
.ai-btn .ic { color: #7c3aed; }
.btn.ai-btn.active { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.copilot { border-color: #ddd6fe; background: linear-gradient(180deg, #faf8ff, #fff 120px); }
.copilot.busy { opacity: .7; }
.cop-head { display: flex; align-items: center; justify-content: space-between; }
.cop-head h3 { margin: 0; color: #4c1d95; }
.cop-head h3 .ic { color: #7c3aed; }
.cop-sub { font-size: 11.5px; color: var(--muted); margin: 2px 0 6px; }
.copilot h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.cop-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); display: grid; gap: 4px; }
.cop-class { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0 0 8px; font-size: 12.5px; }
.cop-class dt { color: var(--muted); }
.cop-class dd { margin: 0; }
.cop-class s { color: var(--muted); }
.cop-loading { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; padding: 10px 0; }
.cop-loading .spinner { width: 16px; height: 16px; border-width: 2px; }
.cop-answer { margin-top: 8px; padding: 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.cop-answer ol, .cop-answer ul { padding-left: 18px; margin: 4px 0; }
.ai-draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: #f5f3ff; border: 1px solid #ddd6fe; color: #5b21b6; border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; font-size: 12.5px; font-weight: 500; }
.avatar.ai { background: #ede9fe; color: #6d28d9; display: inline-grid; place-items: center; border-radius: 50%; }
.msg.auto { border-color: #ddd6fe; border-left: 3px solid #7c3aed; }
.msg.auto .msg-kind, .msg-kind.ai { background: #ede9fe; color: #5b21b6; }
.dev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dev-list li { display: flex; flex-direction: column; gap: 3px; padding: 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); font-size: 13px; }
.dev-list small { font-size: 12px; }
.dev-list .row.gap { margin-top: 4px; }

/* ---------- v1.4: configuración de IA y Microsoft 365 ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.mod-grid .card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.mod-grid .card.off { background: var(--panel-2); }
.mod-grid .card.off > :not(.sec-head):not(.mod-desc) { opacity: .55; }
.mod-desc { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; cursor: pointer; }
.switch input { appearance: none; width: 32px; height: 18px; border-radius: 9px; background: #cbd5e1; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(14px); }
.switch input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.feat-list { display: grid; gap: 2px; }
.feat { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.feat:last-child { border: 0; }
.feat b { display: block; font-size: 13.5px; }
.feat small { color: var(--muted); font-size: 12px; }
.usage-bar { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin: 6px 0 4px; }
.usage-bar span { display: block; height: 100%; background: #7c3aed; border-radius: 4px; }
.prompt-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.prompt-tabs button { border: 1px solid var(--line); background: var(--panel); padding: 5px 10px; border-radius: 6px; font-size: 12.5px; }
.prompt-tabs button.on { background: var(--text); color: #fff; border-color: var(--text); }
.prompt-area { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; min-height: 190px; }
.var-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
.var-chips button { border: 1px dashed #c4b5fd; background: #faf5ff; color: #6d28d9; border-radius: 5px; font-size: 11.5px; padding: 2px 6px; font-family: ui-monospace, Menlo, monospace; }
.rules-tbl td { vertical-align: top; }
.rules-tbl .kw { display: flex; flex-wrap: wrap; gap: 3px; }
.mode-pill { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.mode-pill.fixed { background: #f1f5f9; color: #334155; } .mode-pill.guide_ai { background: #ede9fe; color: #5b21b6; } .mode-pill.ai { background: #e0e7ff; color: #3730a3; }
.test-out { margin-top: 12px; padding: 12px; border-radius: 8px; border: 1px solid #ddd6fe; background: #faf8ff; font-size: 13px; }
.test-out ol { padding-left: 18px; margin: 6px 0; }
.perm-ok { color: var(--ok); font-weight: 600; } .perm-miss { color: var(--warn); font-weight: 600; } .perm-na { color: var(--muted); }
.m365-log { list-style: none; margin: 0; padding: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; max-height: 260px; overflow: auto; }
.m365-log li { padding: 4px 0; border-bottom: 1px solid var(--line-2); display: flex; gap: 8px; }
.m365-log li.error { color: #b45309; }
.m365-log time { color: var(--muted); flex: none; }
.ms-logo { display: inline-grid; grid-template-columns: 8px 8px; gap: 1px; }
.ms-logo i { width: 8px; height: 8px; display: block; }
.mini-device { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }

@media (max-width: 1100px) {
  .kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .age-hist { gap: 6px; height: 170px; }
  .age-col small { white-space: normal; font-size: 10.5px; }
  .mod-grid { grid-template-columns: minmax(0, 1fr); }
}
.su-login { margin-top: 16px; font-size: 13px; }
.su-login summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; }
.ms-main { gap: 8px; }
.home .sec-head { flex-wrap: wrap; }
.btn.passkey { gap: 8px; margin-bottom: 8px; }
.btn.passkey .ic { color: var(--ok); }

/* ---------- v1.6: tipos de proyecto, portfolio y roadmap ---------- */
.block { display: block; }
.danger-text { color: var(--danger); }
.dot-c { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pad { padding: 16px; }
.icon-btn.xs { width: 22px; height: 22px; padding: 0; }
.proj-key.xs { min-width: 0; height: 16px; font-size: 9.5px; padding: 0 4px; border-radius: 4px; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Formulario de proyecto: elección de tipo y etapas */
.type-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 14px; }
.type-opt { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; border-left: 4px solid var(--c); }
.type-opt small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.type-opt:hover { border-color: var(--c); }
.type-opt.on { background: color-mix(in srgb, var(--c) 8%, white); border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
.phase-row.off { opacity: .55; }
.phase-row.off [data-p=name] { text-decoration: line-through; }
.ph-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.pf-more { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.pf-more summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); padding: 2px 0; }
.pf-more[open] summary { margin-bottom: 10px; }

/* Portfolio */
.page.wide { max-width: 1680px; }
.pf-page h1 { display: flex; align-items: center; gap: 8px; }
.pf-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pf-bar .searchbox { flex: 1 1 260px; max-width: 380px; }
.pf-status { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-toggle { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 4px 11px; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.pill-toggle::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); opacity: .35; }
.pill-toggle.on { color: var(--text); border-color: color-mix(in srgb, var(--c) 45%, white); background: color-mix(in srgb, var(--c) 9%, white); }
.pill-toggle.on::before { opacity: 1; }
.pf-filters { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.mini-field { display: inline-flex; flex-direction: column; gap: 2px; min-width: 140px; }
.mini-field > span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.mini-field select { max-width: 220px; }
.kpis button.kpi { font: inherit; text-align: left; cursor: pointer; }
.kpis button.kpi:hover { border-color: var(--brand); }
.kpi.sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.kpi small { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.kpi b small { font-size: 14px; color: var(--muted); font-weight: 500; }
.card.flush { padding: 0; overflow: hidden; }
.pf-table { max-height: calc(100vh - 330px); overflow: auto; }
.pf-table .tbl td { vertical-align: middle; }
.pf-table th.num, .pf-table td.num { text-align: right; }
.pf-name { min-width: 280px; max-width: 420px; }
.ellip-box { display: flex; flex-direction: column; min-width: 0; }
.ellip-box .ellip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-row td { background: var(--panel-2); font-size: 12.5px; padding: 7px 10px; border-top: 1px solid var(--line); }
.prio-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pf-prog { display: flex; align-items: center; gap: 7px; min-width: 130px; }
.pf-prog .progress { flex: 1; height: 7px; }
.pf-prog b { font-size: 12px; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.pf-manual { color: var(--muted); display: inline-flex; }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; color: var(--text-2); }
.health::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pf-phases { display: flex; flex-direction: column; gap: 4px; }
.pf-phase { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 6px; }
.pf-big { font-size: 18px; }
.ph-state { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #cbd5e1; }
.ph-state.st-active { background: var(--info); }
.ph-state.st-done { background: var(--ok); }

/* Roadmap del portfolio */
.rm2-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rm2-range { min-width: 150px; text-align: center; text-transform: capitalize; font-size: 13px; }
.rm2-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.rm2-legend .lg { width: 14px; height: 8px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.lg.h-ok { background: #3b82f6; } .lg.h-risk { background: #f59e0b; } .lg.h-late { background: #ef4444; } .lg.h-done { background: #10b981; }
.lg.rec { background: repeating-linear-gradient(45deg, #94a3b8 0 3px, #e2e8f0 3px 6px); }
.rm2 { --lw: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rm2-head, .rm2-row { display: grid; grid-template-columns: var(--lw) 1fr; }
.rm2-head { background: var(--panel-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.rm2-head .rm2-label { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.rm2-head .rm2-track { height: 34px; }
.rm2-month { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); font-size: 11.5px; color: var(--muted); padding: 9px 0 0 6px; text-transform: capitalize; white-space: nowrap; overflow: hidden; }
.rm2-month.year { border-left: 2px solid #94a3b8; }
.rm2-month small { color: var(--text-2); font-weight: 600; }
.rm2-body { position: relative; max-height: calc(100vh - 340px); overflow: auto; background-image: linear-gradient(to right, transparent calc(var(--lw) - 1px), var(--line) calc(var(--lw) - 1px), var(--line) var(--lw), transparent var(--lw)); }
.rm2-label { padding: 7px 10px; border-right: 1px solid var(--line); display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; background: var(--panel); }
.rm2-label .ellip { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm2-track { position: relative; min-height: 36px; background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(var(--grid, 8.333%) - 1px), var(--line-2) calc(var(--grid, 8.333%) - 1px), var(--line-2) var(--grid, 8.333%)); }
.rm2-row { border-bottom: 1px solid var(--line-2); cursor: pointer; }
.rm2-row:hover .rm2-label, .rm2-row:hover .rm2-track { background-color: #fafbfc; }
.rm2-row.phase { cursor: default; }
.rm2-row.phase .rm2-label { padding-left: 40px; font-size: 12.5px; color: var(--text-2); }
.rm2-row.phase .rm2-track { min-height: 28px; }
.rm2-group { padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: 12.5px; position: relative; z-index: 1; }
.rm2-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--brand); z-index: 3; pointer-events: none; opacity: .7; }
.rmb { position: absolute; top: 8px; height: 20px; border-radius: 6px; background: color-mix(in srgb, #3b82f6 18%, white); border: 1px solid color-mix(in srgb, #3b82f6 45%, white); overflow: hidden; display: flex; align-items: center; }
.rmb-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #3b82f6; opacity: .85; }
.rmb.h-risk { background: #fef3c7; border-color: #fbbf24; } .rmb.h-risk .rmb-fill { background: #f59e0b; }
.rmb.h-late { background: #fee2e2; border-color: #f87171; box-shadow: 0 0 0 1px #ef4444; } .rmb.h-late .rmb-fill { background: #ef4444; }
.rmb.h-done { background: #d1fae5; border-color: #6ee7b7; } .rmb.h-done .rmb-fill { background: #10b981; }
.rmb.h-none .rmb-fill { background: #94a3b8; }
.rmb.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dashed; }
.rmb.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dashed; }
.rmb.recurring { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--c) 22%, white) 0 6px, color-mix(in srgb, var(--c) 8%, white) 6px 12px); border-color: color-mix(in srgb, var(--c) 40%, white); }
.rmb-label { position: relative; z-index: 1; font-size: 11px; font-weight: 600; color: #0f172a; padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 3px rgba(255, 255, 255, .9); }
.rmb-tick { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px solid rgba(255, 255, 255, .95); z-index: 1; }
.rmp { position: absolute; top: 7px; height: 13px; border-radius: 4px; background: #e2e8f0; border: 1px solid #cbd5e1; overflow: hidden; }
.rmp span { display: block; height: 100%; background: #94a3b8; }
.rmp.st-active { background: #dbeafe; border-color: #93c5fd; } .rmp.st-active span { background: #3b82f6; }
.rmp.st-done { background: #d1fae5; border-color: #6ee7b7; } .rmp.st-done span { background: #10b981; }
.rm-out { position: absolute; top: 10px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.rm-out.left { left: 8px; } .rm-out.right { right: 8px; }
.rm2-unplanned { margin-top: 14px; }
.rm2-unplanned .chip { cursor: pointer; }
.rm2-unplanned .chip:hover { border-color: var(--brand); }

/* Vista de proyecto */
.proj-summary { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; margin-bottom: 14px; }
.proj-summary > div { display: flex; flex-direction: column; gap: 2px; }
.proj-summary span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.proj-summary b { font-size: 15px; }
.proj-summary small { font-size: 11px; }
.proj-summary .btn { margin-left: auto; }
.phases-card { margin-top: 14px; }
.phases-card .tbl .input.sm { min-width: 0; }
.phases-card td:nth-child(2) .input { min-width: 200px; }
.proj-head h1 .badge { vertical-align: middle; margin-left: 6px; font-size: 11.5px; }

/* Importación */
.imp-sum { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 14px 0 8px; }
.imp-table { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.imp-table table { min-width: 1150px; }
.imp-table td:last-child { min-width: 240px; }
.imp-table td:nth-child(4) { min-width: 220px; }

/* Configuración */
.cards2 { align-items: start; }
.cards2 .card { margin: 0; }
.api-help { margin-top: 10px; font-size: 13px; }
.api-help summary { cursor: pointer; color: var(--info); }
.api-help ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; }
.key-box { display: flex; gap: 8px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.key-box code { flex: 1; word-break: break-all; background: none; font-size: 13px; }

@media (max-width: 1100px) {
  .rm2 { --lw: 220px; }
  .rm2-legend { display: none; }
}
@media (max-width: 760px) {
  .rm2 { --lw: 140px; }
  .rm2-label .proj-key, .rm2-label .avatar { display: none; }
  .mini-field { min-width: calc(50% - 6px); }
  .mini-field select { max-width: none; }
  .proj-summary .btn { margin-left: 0; }
  .pf-table { max-height: none; }
}

.callout.ok { background: #ecfdf5; border: 1px solid #a7f3d0; }
.steps { margin: 4px 0 14px; padding-left: 20px; line-height: 1.75; }
.ai-internal { margin: 0 0 0 4px; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }

/* v1.7 cierre de ciclo ticket ↔ tareas */
.avatar.cycle { background: #d1fae5; color: #047857; display: inline-grid; place-items: center; border-radius: 50%; }
.msg.note.cycle { background: #f0fdf4; border-color: #a7f3d0; border-left: 3px solid var(--ok); }
.msg.note.cycle .msg-kind { background: #d1fae5; color: #065f46; }
.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; background: var(--panel); }

/* v1.7 roadmap en modo calendario */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cal-side { min-width: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cal-m { text-align: left; background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 128px; min-width: 0; font: inherit; color: inherit; }
.cal-m:hover { border-color: #c9ced8; }
.cal-m.on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.cal-m.past { background: var(--panel-2); }
.cal-m.past .cal-mh b { color: var(--muted); }
.cal-mh { display: flex; align-items: baseline; gap: 5px; }
.cal-mh b { font-size: 13px; text-transform: capitalize; }
.cal-mh small { color: var(--muted); font-size: 11px; }
.cal-now { font-style: normal; font-size: 10px; font-weight: 600; background: var(--brand); color: #fff; border-radius: 4px; padding: 0 5px; margin-left: auto; }
.cal-meter { display: block; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.cal-meter > span { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.cal-meter.lv-limit > span { background: var(--warn); }
.cal-meter.lv-over > span { background: var(--danger); }
.cal-ms { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--muted); }
.lv-ok-text { color: var(--ok); } .lv-limit-text { color: var(--warn); } .lv-over-text { color: var(--danger); }
.cal-over { font-size: 11px; font-weight: 600; color: var(--danger); display: flex; align-items: center; gap: 4px; }
.cal-ends { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-end { display: flex; align-items: center; gap: 5px; font-size: 11.5px; min-width: 0; }
.cal-end::before { content: ""; flex: none; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--brand); }
.cal-end.h-done::before { border-top-color: var(--ok); }
.cal-end.h-late::before { border-top-color: var(--danger); }
.cal-end b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-detail { min-width: 0; }
.cal-dh { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-dh h3 { margin: 0; text-transform: none; }
.cal-detail h4 { margin: 14px 0 6px; }
.lvl { font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.lvl.lv-ok { background: #e3f5ee; color: var(--ok); }
.lvl.lv-limit { background: #fdf0dc; color: #b45309; }
.lvl.lv-over { background: #fde8e8; color: var(--danger); }
.cal-endlist { display: flex; flex-direction: column; }
.cal-endrow { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; text-align: left; font: inherit; color: inherit; font-size: 13px; min-width: 0; }
.cal-endrow:hover { background: var(--panel-2); }
.cal-person { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.cal-person:last-of-type { border-bottom: 0; }
.cal-ph { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cal-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font: inherit; font-size: 12px; color: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px 2px 3px; background: var(--panel-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip:hover { border-color: #c9ced8; background: var(--panel); }
.cal-chip small { color: var(--muted); }
.cal-chip.ends { border-color: #f0b6b6; background: #fff6f6; }
.cal-cap { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.lg.cal-lg-ok { background: var(--ok); } .lg.cal-lg-limit { background: var(--warn); } .lg.cal-lg-over { background: var(--danger); }
.tnum { font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .cal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* v1.8 explorador de la base de datos (superadmin) */
.dbx { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 14px; }
.dbx-tables { padding: 10px; position: sticky; top: 10px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; gap: 8px; }
.dbx-tlist { overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.dbx-t { display: flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 5px 6px; border-radius: 6px; font-size: 12.5px; text-align: left; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dbx-t:hover { background: var(--panel-2); }
.dbx-t.on { background: var(--text); color: #fff; }
.dbx-t small { margin-left: auto; color: var(--muted); font-family: var(--font); font-variant-numeric: tabular-nums; }
.dbx-t.on small { color: #c7ccd6; }
.dbx-mode { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 5px; font-family: var(--font); vertical-align: middle; }
.dbx-mode.m-edit { background: #e6eefd; color: #1d4ed8; } .dbx-mode.m-delete { background: #fdf0dc; color: #b45309; } .dbx-mode.m-read { background: var(--line-2); color: var(--muted); }
.dbx-t .dbx-mode { padding: 2px; }
.dbx-main { min-width: 0; }
.dbx-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.dbx-title { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 0 0 2px; display: flex; gap: 8px; align-items: center; }
.dbx-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.dbx-toggle.on { border-color: var(--danger); background: #fde8e8; color: var(--danger); }
.dbx-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.dbx-tools .searchbox { flex: 1 1 220px; max-width: 320px; }
.dbx-cascade { font-size: 12.5px; color: #b45309; background: #fdf0dc; border-radius: 6px; padding: 6px 10px; display: flex; gap: 6px; align-items: center; }
.dbx-grid { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.dbx-grid table { font-size: 12.5px; }
.dbx-grid th { position: sticky; top: 0; background: var(--panel-2); z-index: 1; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: none; letter-spacing: 0; }
.dbx-grid th small { display: block; font-family: var(--font); font-weight: 400; color: var(--muted); font-size: 10px; }
.dbx-grid td { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.dbx-chk { width: 28px; }
.dbx-null { color: #a3a9b6; font-style: italic; }
.dbx-true { color: var(--ok); font-weight: 600; } .dbx-false { color: var(--muted); }
.dbx-fk { border: 0; background: transparent; padding: 0; color: var(--info); text-decoration: underline dotted; font: inherit; cursor: pointer; }
.dbx-pager { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.dbx-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.dbx-field > span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dbx-nullbox { margin-left: auto; }
.dbx-ro { padding: 7px 10px; background: var(--panel-2); border-radius: 6px; font-size: 13px; min-height: 34px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.dbx-diff td { vertical-align: top; word-break: break-word; }
@media (max-width: 900px) { .dbx { grid-template-columns: minmax(0, 1fr); } .dbx-tables { position: static; max-height: 260px; } .dbx-form { grid-template-columns: minmax(0, 1fr); } }
/* Montserrat tiene números proporcionales: en tablas y cifras se alinean en columnas */
.tbl td, .kpi b, .perf b, .num, .badge { font-variant-numeric: tabular-nums; }
.dbx-tools select.input { width: auto; max-width: 240px; }
.dbx-pager select.input { width: auto; }
.dbx-tables .searchbox { width: 100%; min-width: 0; box-sizing: border-box; }
.dbx-tables .searchbox input { min-width: 0; width: 100%; }
.dbx-diff td:first-child { white-space: nowrap; }

/* v1.9 lista de tickets: orden por columna y celdas editables */
.tickets-tbl th.sortable { cursor: pointer; user-select: none; }
.tickets-tbl th.sortable:hover { color: var(--text); }
.th-sort { display: inline-flex; align-items: center; gap: 4px; }
.sort-arrow { font-style: normal; font-size: 9px; color: #b4bac6; }
.tickets-tbl th.sorted { color: var(--text); }
.tickets-tbl th.sorted .sort-arrow { color: var(--brand); font-size: 10px; }
.cell-stack { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; text-align: left; }
.cell-stack small { font-size: 11px; }
.menu-item.sub { padding-left: 22px; font-size: 12.5px; }

/* v1.9.1: filtros de proyectos y lista del proyecto */
.list-opts select.input { width: auto; max-width: 240px; }
.list-opts .check { white-space: nowrap; }
.list-opts .muted.small { white-space: nowrap; }
.proj-filters-top { align-items: flex-end; }
.pill-toggle.on .icon, .pill-toggle svg { flex: none; }
@media (max-width: 700px) {
  .pf-filters .mini-field { flex: 1 1 140px; min-width: 0; }
  .pf-filters .mini-field select { max-width: none; width: 100%; }
  .pf-filters .mini-field .row { flex-wrap: wrap; }
}

/* v1.9.2: control de fechas (fin no anterior al inicio) */
.input.invalid, .input.invalid:focus { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, white); box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 18%, transparent); }
.input.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 7%, white); }
.date-warn { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; font-weight: 500; color: var(--danger); margin-top: 4px; line-height: 1.35; }
.date-warn svg { flex: none; margin-top: 1px; }
.date-warn.soft { color: #a15c00; font-weight: 400; }
.phase-msg { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 8px; }
.phase-msg:empty { display: none; }

/* v1.9.3: origen / sector IT y horas */
.opt-add { margin-top: 10px; }
.opt-add input[type=color] { width: 38px; height: 30px; padding: 0 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); flex: none; }
.input[readonly] { background: var(--line-2, #f1f3f6); color: var(--muted); cursor: default; }
[data-hours-hint]:empty { display: none; }
.pf-lists { display: grid; gap: 16px; margin-bottom: 8px; }
.pf-opt-tbl td:first-child { width: 100%; }
.pf-opt-tbl input[name=name] { width: 100%; min-width: 180px; }
.pf-opt-tbl input[type=color], .edit-tbl input[type=color] { width: 38px; height: 28px; padding: 0 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }

/* v1.9.4: fechas de etapas calculadas */
.phase-row .input.auto { color: var(--muted); font-style: italic; background: var(--line-2); border-style: dashed; }
.phase-row .input.required-mark:not(.invalid) { font-weight: 600; }

/* v1.9.5: etapas en el tablero */
.board-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.board-head .board-phases { margin-left: auto; align-self: center; white-space: nowrap; }
.kcard.phase-card { border-left: 3px solid #7c3aed; background: color-mix(in srgb, #7c3aed 4%, var(--panel)); }
.phase-card .pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.phase-card .pc-num { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #7c3aed; }
.phase-card .progress { height: 5px; margin: 8px 0 6px; }
.phase-card .progress span { background: #7c3aed; }
.auth-card .btn.ms, .auth-card .ms-main { display: flex; align-items: center; justify-content: center; gap: 9px; height: 42px; font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; line-height: 1; }
.auth-card .btn.ms svg, .auth-card .ms-main svg { flex: none; display: block; }
.auth-card .btn.ms:hover { border-color: #b9c0cb; background: var(--line-2); }

/* v1.9.6: imágenes externas bloqueadas en correos entrantes */
.remote-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); background: var(--line-2); border-radius: 6px; padding: 5px 9px; margin: 4px 0 8px; }
img.remote-img { display: inline-block; min-width: 24px; min-height: 18px; border: 1px dashed var(--line); border-radius: 4px; }
img.remote-img { cursor: pointer; }

/* v1.9.7: mascota en las pantallas de ingreso (dibujo y gestos en mascota.css) */
.auth-mascota[hidden] { display: none; }
.auth-card.con-mascota .auth-logo { justify-content: center; text-align: center; }
.auth-card.con-mascota .auth-logo .auth-iso[hidden] { display: none; }
.ver-clave-row { display: flex; justify-content: flex-end; margin: -6px 0 8px; }
.ver-clave-row .ver-clave[hidden] { display: none; }
.ver-clave { font-size: 12px; text-decoration: underline; }
