/* =========================================================================
   TaskFlow 4 · componentes de plataforma (se carga después de app.css)
   Dashboards, proyectos, vistas nuevas, módulos empresariales, modo oscuro y móvil.
   ========================================================================= */

/* ---------------- utilidades ---------------- */
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.chips-row label.chip { cursor: pointer; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.bad { color: var(--bad); }
td.bad, span.bad, b.bad, small.bad { color: var(--bad); }
td.ok, span.ok { color: var(--ok); }
.c { text-align: center; }
.req { color: var(--bad); }
.flabel { font-size: 12.5px; color: var(--text-2); font-weight: 600; margin: 4px 0 6px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.split > .card { margin: 0; }
.kebab { position: relative; }
.skeleton-block { height: 240px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line-2) 50%, var(--surface-2) 75%); background-size: 400% 100%; animation: sk 1.2s ease infinite; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.muted-in { color: var(--muted); }
input.sm, select.sm { height: 30px; padding: 0 8px; font-size: 12.5px; }
.old-v { color: var(--bad); text-decoration: line-through; opacity: .8; }
.new-v { color: var(--ok); font-weight: 600; }

/* ---------------- barra superior ---------------- */
.topbar button.search { display: inline-flex; align-items: center; gap: 8px; width: min(340px, 34vw); height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--muted); font: inherit; cursor: pointer; }
.topbar button.search span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar button.search kbd, kbd { font: 600 10.5px/1 var(--font); padding: 3px 6px; border-radius: 5px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.topbar button.search:hover { border-color: #c3cfe2; }
.timer-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 10px; border-radius: 99px; background: var(--bad-soft); color: var(--bad); font-size: 12.5px; }
.timer-chip a { color: inherit; }
.timer-chip .rec { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: rec 1.2s infinite; }
.timer-chip .t-clock { font-variant-numeric: tabular-nums; font-weight: 700; }
@keyframes rec { 50% { opacity: .25; } }
.fav .ic { width: 17px; height: 17px; }
.fav.on { color: var(--gold-d); }
.fav.on .ic { fill: var(--gold); }
.side-scroll { flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.side-user { display: flex; align-items: center; gap: 10px; margin: 0 2px 8px; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, .07); color: #fff; }
.side-user:hover { text-decoration: none; background: rgba(255, 255, 255, .11); }
.side-user .avatar { background: var(--gold); color: var(--navy); width: 34px; height: 34px; }
.side-user b { display: block; font-size: 13px; }
.side-user small { display: block; color: #8ea0bd; font-size: 11.5px; }
.side-user .online { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.side-recents summary { cursor: pointer; list-style: none; }
.side-recents summary::-webkit-details-marker { display: none; }
.side-recents summary::before { content: "▸ "; }
.side-recents[open] summary::before { content: "▾ "; }
.badge-n { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 99px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.badge-n.gold { background: var(--gold); color: var(--navy); }
.logo.img { background: #fff; overflow: hidden; padding: 2px; }
.logo.img img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------------- paleta de comandos y menú contextual ---------------- */
.palette-wrap { position: fixed; inset: 0; z-index: 200; background: rgba(8, 20, 40, .45); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.palette { width: min(640px, 94vw); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--line); }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pal-input input { border: 0; box-shadow: none !important; height: 32px; font-size: 15px; padding: 0; background: transparent; }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.pal-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.pal-list button small { display: block; color: var(--muted); font-size: 11.5px; }
.pal-list button b { font-weight: 550; }
.pal-list button.on, .pal-list button:hover { background: var(--primary-soft); }
.pal-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; font-weight: 700; }
.pal-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.ctx-menu { position: fixed; z-index: 250; min-width: 210px; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; }
.ctx-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 7px; font: inherit; font-size: 13px; color: var(--text); text-align: left; cursor: pointer; white-space: pre; }
.ctx-menu button:hover { background: var(--primary-soft); }
.ctx-menu button.danger { color: var(--bad); }
.ctx-menu button:disabled { opacity: .45; cursor: default; }
.ctx-menu kbd { margin-left: auto; }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------------- pestañas, filtros y KPI genéricos ---------------- */
.tabs-bar { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; flex-wrap: nowrap; }
.tabs-bar > a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs-bar > a:hover { color: var(--text); text-decoration: none; }
.tabs-bar > a.on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs-bar select { width: auto; height: 32px; }
.filters-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 12px 14px; }
.filters-bar label { margin: 0; font-size: 11.5px; }
.filters-bar label > input, .filters-bar label > select { margin-top: 3px; height: 32px; width: auto; min-width: 130px; }
.search-in { position: relative; min-width: 200px; flex: 1; max-width: 320px; }
.search-in .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-in input { padding-left: 32px; height: 32px; }
.kpi-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; align-items: stretch; }
.kpi-row .kpi { flex: 1 1 140px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-sm); display: block; }
.kpi-row .kpi b { display: block; font-size: 22px; color: var(--navy); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-row .kpi small { color: var(--muted); font-size: 12px; }
.kpi-row .kpi.bad b { color: var(--bad); }
.kpi-row .kpi.ok b { color: var(--ok); }
.kpi-row .kpi.warn b { color: var(--warn); }
.kpis-inline { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--text-2); }
.pager { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pager a, .pager span { min-width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); padding: 0 8px; font-size: 12.5px; }
.pager a.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager span { border: 0; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.seg a, .seg button { border: 0; background: none; padding: 4px 10px; border-radius: 7px; font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.seg a:hover { text-decoration: none; }
.seg .on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 600; }
.ms-dd { position: relative; }
.ms-dd > summary { list-style: none; }
.ms-dd > summary::-webkit-details-marker { display: none; }
.ms-list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 240px; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-m); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ms-list label.chk { white-space: normal; }

/* ---------------- tablas de apoyo ---------------- */
table.simple th.sortable, .sheet th.sortable { cursor: pointer; user-select: none; }
.perm-matrix th.c { font-size: 11px; writing-mode: horizontal-tb; white-space: nowrap; }
.perm-matrix td.c .ic { width: 15px; height: 15px; }
.perm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.perm-item { align-items: flex-start !important; white-space: normal !important; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; }
.perm-item span { display: flex; flex-direction: column; }
.perm-item small { font-weight: 400; }
.audit-table td { vertical-align: top; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.hub-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--surface-2); }
.hub-item:hover { text-decoration: none; border-color: #bcd0ea; background: var(--primary-soft); }
.hub-item > .ic { width: 22px; height: 22px; color: var(--primary); margin-top: 2px; }
.hub-item b { display: block; }
.hub-item small { color: var(--muted); font-size: 12px; }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.icon-pick button { height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; color: var(--text-2); }
.icon-pick button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.brand-prev { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; background: var(--navy); color: #fff; margin-bottom: 8px; min-height: 58px; }
.brand-up input[type=file] { height: auto; padding: 6px; }
td.drag { width: 26px; color: var(--muted); cursor: grab; }

/* ---------------- proyectos ---------------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filterbar select, .filterbar input { width: auto; height: 34px; }
.pcard { position: relative; }
.pcard.is-archived { opacity: .7; }
.pcard .stretched::after { content: ""; position: absolute; inset: 0; }
.pcard .kebab, .pcard .fav { position: relative; z-index: 2; }
.kebab-pop { position: absolute; right: 0; top: 36px; z-index: 30; min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-m); padding: 5px; }
.kebab-pop button, .kebab-pop a { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 7px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; }
.kebab-pop button:hover, .kebab-pop a:hover { background: var(--primary-soft); text-decoration: none; }
.projects-table td { vertical-align: middle; }
.mini-prog { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; min-width: 50px; }
.mini-prog span { display: block; height: 100%; background: linear-gradient(90deg, var(--sky), #56a3ea); border-radius: 99px; }
.tcard .mini-prog { margin-top: 6px; }

/* ---------------- dashboard de widgets ---------------- */
.hero-sm { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 24px 28px; border-radius: 16px; margin-bottom: 18px; color: #fff; background: radial-gradient(120% 140% at 100% 0, rgba(244, 180, 0, .28), transparent 45%), linear-gradient(120deg, var(--navy), var(--navy-3)); box-shadow: 0 12px 30px -16px rgba(10, 58, 115, .7); }
.hero-sm h1 { color: #fff; font-size: 26px; }
.hero-sm p { color: #d7e3f5; }
.hero-sm select { width: auto; background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .25); }
.hero-sm select option { color: var(--text); }
.hero-sm .btn:not(.gold) { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .25); box-shadow: none; }
.hero-sm .icon-btn { color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 650; }
.btn.gold:hover { background: #ffc21a; }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.widget { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.widget.s2 { grid-column: span 2; }
.widget.s3 { grid-column: 1 / -1; }
.dash-grid.editing .widget { outline: 2px dashed #bcd0ea; outline-offset: 2px; cursor: grab; }
.widget.dragging { opacity: .4; }
.wbody { min-width: 0; }
.wcfg { border-top: 1px solid var(--line-2); margin-top: 10px; padding-top: 10px; }
.widget-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 60vh; overflow-y: auto; }
.wp-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); text-align: left; font: inherit; color: var(--text); }
.wp-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.wp-item small { display: block; color: var(--muted); }
.wp-add { display: grid; place-items: center; min-height: 120px; border: 2px dashed #c9d5e6; border-radius: 12px; color: var(--muted); cursor: pointer; background: none; font: inherit; }
.w-stat { display: flex; gap: 10px; margin-bottom: 8px; }
.w-stat > div { flex: 1; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line-2); }
.w-stat b { display: block; font-size: 20px; color: var(--navy); }
.w-stat small { color: var(--muted); font-size: 11.5px; }
.w-stat .bad b { color: var(--bad); }
.w-empty { padding: 8px 0; }
.w-note { color: var(--muted); font-size: 12px; margin-top: 6px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 340px; }
.chart-box { position: relative; height: 280px; }
.up-row { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line-2); color: var(--text); cursor: pointer; min-width: 0; }
.up-row:last-child { border-bottom: 0; }
.up-row:hover { background: var(--surface-2); text-decoration: none; }
.sprint-row, .wl { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.md-check { list-style: none; padding-left: 4px; }
.md-table { border-collapse: collapse; margin: 8px 0; width: 100%; }
.md-table td { border: 1px solid var(--line); padding: 5px 8px; }
.md-table tr:first-child td { font-weight: 650; background: var(--surface-2); }
.inline-label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.dash-edit { display: flex; gap: 6px; }

/* ---------------- objetivos, portafolios y riesgos ---------------- */
.goal-list { display: flex; flex-direction: column; gap: 8px; }
.goal-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.goal-row:hover { border-color: #c3cfe2; }
.gicon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.lv-estrategico .gicon { background: var(--gold-soft); color: var(--gold-d); }
.lv-resultado .gicon { background: var(--ok-soft); color: var(--ok); }
.gprog { width: 170px; display: flex; align-items: center; gap: 8px; }
.st-en_riesgo { color: var(--warn); } .st-atrasado { color: var(--bad); } .st-logrado { color: var(--ok); }
.goal-detail { border-left: 3px solid var(--primary); }
.goal-link { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.muted-card { background: var(--surface-2); }
.pf-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 12px; }
.pf-proj { display: flex !important; align-items: center; gap: 7px; white-space: normal !important; padding: 5px 6px; border-radius: 7px; }
.pf-proj:hover { background: var(--surface-2); }
.pf-budget { width: 76px !important; height: 28px !important; margin-left: auto; font-size: 12px; }
.pf-row { display: grid; grid-template-columns: 220px 1fr 70px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.pf-timeline { position: relative; }
.pf-track { position: relative; height: 16px; background: var(--surface-2); border-radius: 6px; }
.pf-track > span { position: absolute; top: 3px; height: 10px; border-radius: 5px; background: var(--sky); }
.pf-track > span.late { background: var(--bad); }
.small-b { font-size: 12px; font-weight: 650; }
.dep-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.risk-split { grid-template-columns: 340px minmax(0, 1fr); }
.risk-matrix { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 0 0 22px 26px; }
.rm-rowx { display: grid; grid-template-columns: 18px repeat(5, 1fr); gap: 4px; align-items: center; }
.rm-rowx b { font-size: 11px; color: var(--muted); text-align: center; }
.rm-rowx .cell { aspect-ratio: 1; border-radius: 7px; display: grid; place-items: center; font-weight: 700; color: #fff; opacity: .55; }
.rm-rowx .cell.has { opacity: 1; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12); }
.cell.s1, .risk-score.s1 { background: #22A55A; } .cell.s2, .risk-score.s2 { background: #F4B400; } .cell.s3, .risk-score.s3 { background: #E5484D; }
.rm-axis { position: absolute; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.rm-axis.y { left: -18px; top: 45%; transform: rotate(-90deg); }
.rm-axis.x { bottom: 0; left: 50%; }
.risk-score { display: inline-grid; place-items: center; min-width: 28px; height: 24px; border-radius: 7px; color: #fff; font-weight: 700; font-size: 12px; padding: 0 6px; }

/* ---------------- equipos y carga ---------------- */
.team-card.is-me { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.avatar.over { background: var(--bad-soft); color: var(--bad); box-shadow: 0 0 0 2px var(--bad); }
.abs-form { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 1.5fr auto; gap: 8px; align-items: center; margin-bottom: 10px; }
.abs-form input, .abs-form select { height: 34px; }
.who { display: flex; align-items: center; gap: 10px; }
.wl-table td, .wl-table th { padding: 7px 8px; }
.wl-table .wl-day { text-align: center; font-size: 11px; color: var(--muted); padding: 6px 2px; min-width: 34px; }
.wl-table .wl-day small { display: block; font-weight: 700; color: var(--text-2); }
.wl-table .wl-day.today small { color: var(--primary); }
.wl-row { cursor: pointer; }
.wl-row:hover { background: var(--surface-2); }
.wl-cell { text-align: center; font-size: 11px; font-weight: 650; border-left: 1px solid var(--surface); min-width: 34px; }
.wl-cell.free { background: #eef8f1; color: #9ab7a4; }
.wl-cell.some { background: #cfeedd; color: #16603a; }
.wl-cell.full { background: #fff1c7; color: #7a5210; }
.wl-cell.over { background: #ffd9d9; color: #a12b2b; }
.wl-cell.off { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--line-2) 4px, var(--line-2) 8px); }
.wl-cell.x { background: #ffb3b3; color: #7d1111; }
.wl-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 3px; min-width: 60px; }
.wl-bar span { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.wl-bar.completo span { background: var(--gold); }
.wl-bar.sobrecarga span { background: var(--bad); }
.wl-st { color: var(--muted); font-size: 11.5px; }
.wl-st.sobrecarga { color: var(--bad); }
.wl-items { list-style: none; margin: 0; padding: 4px 0; display: grid; gap: 4px; }
.wl-items li { display: flex; justify-content: space-between; gap: 10px; }
.wl-detail td { background: var(--surface-2); }
.wl-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------------- hoja de tiempos ---------------- */
.ts-grid th small { display: block; font-weight: 500; color: var(--muted); }
.ts-grid th.today { color: var(--primary); }
.ts-cell { cursor: pointer; }
.ts-cell:hover { background: var(--primary-soft); }
.ts-cell.we { background: var(--surface-2); }
.ts-grid tfoot th { background: var(--surface-2); }

/* ---------------- centro de reportes ---------------- */
.rep-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.rep-nav { padding: 6px; position: sticky; top: 74px; }
.rep-nav a { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 9px; color: var(--text); }
.rep-nav a:hover { background: var(--surface-2); text-decoration: none; }
.rep-nav a.on { background: var(--primary-soft); color: var(--primary); }
.rep-nav a .ic { margin-top: 2px; }
.rep-nav b { display: block; font-size: 13px; }
.rep-nav small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.rep-main { min-width: 0; }
.rep-title { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }

/* ---------------- filtros avanzados ---------------- */
.filters-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.saved-filters { padding: 10px; position: sticky; top: 74px; }
.saved-filters hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.sf { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; color: var(--text); min-width: 0; }
.sf:hover { background: var(--surface-2); text-decoration: none; }
.sf.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sf-row { display: flex; align-items: center; gap: 4px; }
.fb { padding: 14px; }
.fb-head, .fb-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-head select, .fb-foot select { width: auto; height: 32px; }
.fb-head label.opt { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.fb-conds { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.fb-row { display: grid; grid-template-columns: 220px 200px minmax(0, 1fr) 30px; gap: 8px; align-items: center; }
.fb-row select, .fb-row input { height: 34px; }
.fb-noval { padding-left: 6px; }

/* ---------------- documentación ---------------- */
.docs-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.docs-tree { padding: 10px; position: sticky; top: 74px; max-height: calc(100vh - 100px); overflow-y: auto; }
.docs-search { position: relative; margin-bottom: 8px; }
.docs-search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.docs-search input { padding-left: 32px; height: 34px; }
.docs-new { display: flex; gap: 6px; margin-bottom: 8px; }
.docs-new .btn { flex: 1; }
.tree { display: flex; flex-direction: column; gap: 1px; }
.tree a { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 7px; color: var(--text-2); font-size: 13px; min-width: 0; }
.tree a:hover { background: var(--surface-2); text-decoration: none; }
.tree a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.docs-main { min-width: 0; }
.docs-hero { display: flex; gap: 16px; align-items: flex-start; }
.docs-hero .empty-ic { margin: 0; }
.doc-view { padding: 24px 32px; }
.doc-title { font-size: 26px; }
.doc-crumbs a { color: var(--muted); }
.md-body { line-height: 1.7; font-size: 14px; overflow-wrap: anywhere; }
.md-body h2 { font-size: 20px; margin: 18px 0 6px; } .md-body h3 { font-size: 17px; margin: 14px 0 6px; } .md-body h4, .md-body h5 { margin: 12px 0 4px; }
.md-body blockquote { margin: 8px 0; padding: 6px 14px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 8px 8px 0; }
.md-body pre { background: #0f1b2d; color: #dbe7f7; padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
.md-body pre code { background: none; color: inherit; padding: 0; }
.md-body hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md-body.sm { font-size: 13px; line-height: 1.55; }
.md-body a.mention { font-weight: 600; }
.doc-editor { display: flex; flex-direction: column; gap: 10px; }
.doc-title-in { font-size: 20px; font-weight: 650; height: 44px; }
.md-toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: var(--surface-2); }
.md-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.md-split textarea { min-height: 460px; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; line-height: 1.6; resize: vertical; }
.md-preview { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; max-height: 620px; overflow-y: auto; background: var(--surface); }
.cmt { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.cmt:last-of-type { border-bottom: 0; }

/* ---------------- archivos ---------------- */
.files-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.files-cats { padding: 8px; position: sticky; top: 74px; }
.files-cats a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); }
.files-cats a:hover { background: var(--surface-2); text-decoration: none; }
.files-cats a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.files-cats small { color: var(--muted); }
.file-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.file-tile { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); min-width: 0; }
.file-tile:hover { border-color: #bcd0ea; text-decoration: none; box-shadow: var(--shadow-m); }
.ft-thumb { height: 110px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.ft-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ft-thumb .ic { width: 34px; height: 34px; }
.ft-thumb small { display: block; font-weight: 700; }
.bulk-top { border-bottom: 1px solid var(--line); margin: 0; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; border: 2px dashed #c9d5e6; border-radius: 12px; cursor: pointer; text-align: center; color: var(--text-2); position: relative; }
.dropzone .ic { width: 28px; height: 28px; color: var(--primary); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: 100%; }

/* ---------------- formularios ---------------- */
.form-card.off { opacity: .65; }
.form-builder { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.fb-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.fb-item { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.fb-item .drag { cursor: grab; color: var(--muted); padding-top: 8px; }
.fb-item .grow { display: flex; flex-direction: column; gap: 6px; }
.fb-item .row select { width: auto; height: 30px; }
.form-fill { max-width: 760px; }
.form-fill.public { max-width: none; }
.ff { margin-bottom: 14px; }
.ff > span { display: block; margin-bottom: 4px; color: var(--text); font-weight: 600; font-size: 13px; }
label.chk.ff { display: flex; margin-bottom: 14px; white-space: normal; }
.copy-row { display: flex; gap: 6px; margin: 6px 0 12px; }
.copy-row input { font-size: 12px; }

/* ---------------- perfil y plataforma ---------------- */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; background: var(--primary); color: #fff; }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-day { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 12px 0 6px -18px; }
.tl-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; position: relative; }
.tl-dot { position: absolute; left: -17px; width: 10px; height: 10px; border-radius: 50%; background: var(--sky); border: 2px solid var(--surface); }

/* ---------------- papelera ---------------- */
.chips-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------------- vista de proyecto: pestañas de vista ---------------- */
.view-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: -6px 0 14px; scrollbar-width: none; }
.view-tabs::-webkit-scrollbar { display: none; }
.view-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--muted); font-weight: 550; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.view-tabs a:hover { color: var(--text); text-decoration: none; }
.view-tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.view-tabs .ic { width: 15px; height: 15px; }

/* ---------------- tabla editable ---------------- */
.sheet-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-height: calc(100vh - 260px); box-shadow: var(--shadow-sm); }
.sheet { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
.sheet th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sheet th.sorted { color: var(--primary); }
.sheet td { padding: 3px 6px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
.sheet td.c-key { position: sticky; left: 0; background: var(--surface); z-index: 1; display: flex; align-items: center; gap: 6px; height: 40px; }
.sheet .c-sel { width: 34px; text-align: center; }
.sheet tr:hover td { background: var(--surface-2); }
.sheet tr.is-sel td { background: var(--primary-soft); }
.sheet tr.is-done .cell-title { text-decoration: line-through; color: var(--muted); }
.sheet input, .sheet select { height: 32px; border-color: transparent; background: transparent; padding: 4px 6px; border-radius: 6px; min-width: 0; }
.sheet input:hover, .sheet select:hover { border-color: var(--line); background: var(--surface); }
.sheet input:focus, .sheet select:focus { background: var(--surface); }
.sheet .cell-title { min-width: 270px; font-weight: 500; }
.sheet .c-points input { width: 60px; } .sheet .c-estimate input { width: 86px; }
.sheet input.late { color: var(--bad); }
.sheet .c-progress { display: flex; align-items: center; gap: 6px; height: 40px; }
.sheet .c-progress .mini-prog { flex: 1; }
.sheet tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-size: 12px; padding: 8px; border-top: 1px solid var(--line); }
.sheet a.tkey { cursor: pointer; }
.prio-sel.p-critica { color: #d23f3f; font-weight: 600; } .prio-sel.p-alta { color: #e8641b; } .prio-sel.p-baja { color: #2f6fdb; }

/* ---------------- dependencias ---------------- */
.deps-top { display: flex; flex-direction: column; gap: 10px; }
.dep-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dep-add select { width: auto; max-width: 320px; height: 34px; }
.deps-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin-bottom: 16px; max-height: 70vh; }
.deps-canvas { position: relative; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.deps-canvas svg { position: absolute; inset: 0; pointer-events: none; }
.dep-edge { fill: none; stroke-width: 2; pointer-events: stroke; }
.dep-edge.soft { stroke-dasharray: 5 5; stroke-width: 1.5; }
.dep-edge.crit { stroke-width: 3; }
.dep-node { position: absolute; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); box-shadow: var(--shadow); cursor: pointer; font-size: 12.5px; }
.dep-node:hover { box-shadow: var(--shadow-m); border-color: #bcd0ea; }
.dep-node.crit { box-shadow: 0 0 0 2px #E5484D; }
.dep-node.done { background: var(--surface-2); }
.dep-node.done .dn-title { color: var(--muted); text-decoration: line-through; }
.dep-node.blocked { background: #fff7f7; }
.dn-top { display: flex; align-items: center; gap: 6px; }
.dn-title { font-weight: 600; color: var(--text); }
.dn-foot { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); display: inline-block; }
.cp-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bad-soft); color: var(--bad); font-size: 11px; font-weight: 700; }

/* ---------------- Gantt: dependencias, ruta crítica, hitos ---------------- */
.gantt { position: relative; }
.g-deps { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; overflow: visible; }
.g-dep { fill: none; stroke: #64748b; stroke-width: 1.5; opacity: .85; }
.g-dep.crit { stroke: #E5484D; stroke-width: 2.2; }
.g-dep.conflict { stroke: #d9730d; stroke-dasharray: 4 3; }
.g-bar.crit { box-shadow: 0 0 0 2px #E5484D; }
.g-row.crit .g-label { color: var(--bad); }
.g-label.sub { padding-left: 34px; }
.g-milestone.head { top: auto; bottom: 2px; }

/* ---------------- roadmap ---------------- */
.rm-opts { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.rm-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.rm { min-width: calc(280px + var(--w)); position: relative; }
.rm-row { display: grid; grid-template-columns: 280px var(--w); border-bottom: 1px solid var(--line-2); min-height: 48px; }
.rm-row.dim { opacity: .7; }
.rm-label { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); padding: 8px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.rm-label b { display: block; font-size: 13px; }
.rm-label small { display: block; font-size: 11.5px; }
.rm-track { position: relative; }
.rm-track::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--tx); border-left: 2px dashed var(--gold); opacity: .7; }
.rm-head { position: sticky; top: 0; z-index: 3; background: var(--surface-2); min-height: 40px; }
.rm-head .rm-label { background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.rm-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); padding: 10px 8px; font-size: 12px; font-weight: 650; color: var(--text-2); white-space: nowrap; }
.rm-ms { position: absolute; bottom: -7px; width: 12px; height: 12px; transform: translateX(-6px) rotate(45deg); background: var(--gold); border: 2px solid var(--surface); z-index: 4; }
.rm-ms span { display: none; }
.rm-bar { position: absolute; top: 10px; height: 28px; border-radius: 8px; background: color-mix(in srgb, #9B4FC0 18%, var(--surface)); border: 1px solid color-mix(in srgb, #9B4FC0 45%, var(--surface)); overflow: hidden; cursor: pointer; }
.rm-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, #9B4FC0 45%, var(--surface)); }
.rm-bar span { position: relative; padding: 0 10px; line-height: 26px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; color: var(--text); }
.rm-bar.late { border-color: var(--bad); }
.rm-bar.done { opacity: .65; }
.rm-nodate { position: absolute; top: 15px; left: 12px; }

/* ---------------- sprints ---------------- */
.sprint-card.active { border-color: #9ed3b5; box-shadow: 0 0 0 2px var(--ok-soft); }
.sprint-card.cancelled { opacity: .7; }
.sprint-card .row { margin-top: 4px; }
.retro { border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; background: var(--surface-2); }
.retro summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.retro h4 { display: flex; align-items: center; gap: 6px; }
.cap-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); }
.cap-chip.over { background: var(--bad-soft); color: var(--bad); }
.bl-row.selectable { grid-template-columns: 16px 16px 20px auto minmax(120px, 1fr) auto auto auto 20px 24px; }
.bl-sel { margin: 0; }
.bl-row.is-sel { background: var(--primary-soft); }
.pts-edit[data-pts-edit] { cursor: pointer; }
.pts-edit[data-pts-edit]:hover .pts { box-shadow: 0 0 0 2px var(--sky); }

/* ---------------- calendario semana / día ---------------- */
.cal-days { display: grid; gap: 8px; }
.cal-days.week { grid-template-columns: repeat(7, minmax(150px, 1fr)); overflow-x: auto; }
.cal-days.day { grid-template-columns: 1fr; max-width: 820px; }
.cal-col { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 380px; display: flex; flex-direction: column; gap: 6px; }
.cal-col.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal-col.we { background: var(--surface-2); }
.cal-col.over { outline: 2px dashed var(--sky); }
.cal-col-head { display: flex; align-items: baseline; gap: 6px; padding: 2px 4px 6px; border-bottom: 1px solid var(--line-2); }
.cal-col-head .cal-add { margin-left: auto; }
.cal-item { border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 8px; padding: 6px 8px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.cal-item:hover { box-shadow: var(--shadow-m); }
.cal-item.done { opacity: .6; }
.cal-item.late { border-color: #f4c4c4; }
.ci-top, .ci-foot { display: flex; align-items: center; gap: 5px; }
.ci-title { font-size: 12.5px; font-weight: 550; }
.cal-empty { text-align: center; padding: 16px 0; }

/* ---------------- comentarios v4, detalle de incidencia ---------------- */
.cfoot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.react { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 7px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; font-size: 12px; color: var(--text-2); }
.react.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.react .ic { width: 14px; height: 14px; }
.react-add { position: relative; }
.react-pop { position: absolute; bottom: 28px; left: 0; z-index: 10; display: flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; box-shadow: var(--shadow-m); }
.react-pop button { border: 0; background: none; font-size: 17px; cursor: pointer; padding: 2px 5px; border-radius: 50%; }
.react-pop button:hover { background: var(--surface-2); }
.replies { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.comment.reply .avatar { width: 22px; height: 22px; font-size: 9px; }
.reply-banner { display: flex; align-items: center; gap: 6px; padding: 5px 10px; margin-bottom: 6px; background: var(--primary-soft); color: var(--primary); border-radius: 8px; font-size: 12.5px; }
.cedit-in { margin: 4px 0 6px; }
.cvers h4 { margin: 12px 0 2px; font-size: 12px; color: var(--muted); }
.task-docs { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.task-docs a { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
dd.ro { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.ms-inline { display: flex; flex-direction: column; gap: 4px; }
.cur-in { display: flex; align-items: center; gap: 6px; }
.cur-in span { color: var(--muted); font-weight: 600; }
.wf-diagram { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 6px; color: var(--text); }
.chips-nav .chip.on { background: var(--primary); color: #fff; }
.chips-nav a.chip:hover { text-decoration: none; filter: brightness(.97); }
mark { background: var(--gold-soft); color: inherit; padding: 0 2px; border-radius: 3px; }
.notif .icon-btn { margin-left: 4px; opacity: .6; }
.notif:hover .icon-btn { opacity: 1; }
.tabs-bar a .chip { margin-left: 2px; }

/* ---------------- modo oscuro ---------------- */
html.theme-dark {
  --bg: #0d1522; --surface: #141f30; --surface-2: #192740; --line: #25344d; --line-2: #1d2b42;
  --text: #e3e9f3; --text-2: #b4c0d3; --muted: #7f8ea8; --navy: #9cc2f0; --primary: #4d95e8; --primary-2: #6aa8ee; --primary-soft: #16304f;
  --ok-soft: #133524; --bad-soft: #3a1a1e; --warn-soft: #3a2d12; --gold-soft: #3a3113; --warn: #e2b04a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-m: 0 6px 20px -6px rgba(0, 0, 0, .55); color-scheme: dark;
}
html.theme-dark body { background: var(--bg); }
html.theme-dark .sidebar { background: #09111d; }
html.theme-dark .topbar { background: rgba(20, 31, 48, .92); border-color: var(--line); }
html.theme-dark input, html.theme-dark select, html.theme-dark textarea { background: #0f1928; border-color: #2b3c58; color: var(--text); }
html.theme-dark input:disabled, html.theme-dark select:disabled { background: #121c2c; }
html.theme-dark .btn { background: var(--surface-2); border-color: var(--line); color: var(--text); }
html.theme-dark .btn:hover, html.theme-dark .icon-btn:hover, html.theme-dark .btn.ghost:hover { background: #22344f; }
html.theme-dark .btn.primary { background: #2a6fc4; border-color: #2a6fc4; color: #fff; }
html.theme-dark .btn.gold { background: var(--gold); color: #1b1300; }
html.theme-dark code, html.theme-dark .chip, html.theme-dark .vchip, html.theme-dark .pts, html.theme-dark .avatar.more { background: #22324b; color: var(--text-2); }
html.theme-dark .avatar { background: #2b3f5f; color: #cfe0f7; }
html.theme-dark .avatar.unassigned { background: transparent; }
html.theme-dark .avatars .avatar { border-color: var(--surface); }
html.theme-dark .modal, html.theme-dark dialog { background: var(--surface); color: var(--text); }
html.theme-dark table.simple th, html.theme-dark table.tasks th { background: var(--surface-2); color: var(--muted); }
html.theme-dark table.simple td, html.theme-dark table.tasks td { border-color: var(--line-2); }
html.theme-dark .status-pill { color: color-mix(in srgb, var(--c) 70%, #fff); background: color-mix(in srgb, var(--c) 22%, transparent); }
html.theme-dark .lchip { color: color-mix(in srgb, var(--c) 65%, #fff); background: color-mix(in srgb, var(--c) 22%, transparent); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
html.theme-dark .empty { background: var(--surface); border-color: var(--line); }
html.theme-dark .progress, html.theme-dark .stackbar { background: #22324b; }
html.theme-dark .tcard, html.theme-dark .col-body, html.theme-dark .bl-row, html.theme-dark .cal-day, html.theme-dark .g-label, html.theme-dark .g-row, html.theme-dark .group, html.theme-dark .bl-section { background-color: var(--surface); border-color: var(--line); color: var(--text); }
html.theme-dark .col-head, html.theme-dark .board-row.head, html.theme-dark .g-header, html.theme-dark .cal-head { background: var(--surface-2); color: var(--text-2); }
html.theme-dark .alert.ok { color: #7fe0a8; border-color: #1f5a3a; }
html.theme-dark .alert.err { color: #ff9ea1; border-color: #5a2328; }
html.theme-dark .alert.warn { color: #f1cc7a; border-color: #5a4518; }
html.theme-dark .wl-cell.free { background: #13291d; color: #4c7a5e; }
html.theme-dark .wl-cell.some { background: #1b4a31; color: #9fe1bb; }
html.theme-dark .wl-cell.full { background: #4a3c13; color: #f3d98a; }
html.theme-dark .wl-cell.over { background: #5a1f24; color: #ffc1c3; }
html.theme-dark .dep-node.blocked { background: #2a1a20; }
html.theme-dark .md-body pre { background: #0a1220; }
html.theme-dark .hero-sm { background: radial-gradient(120% 140% at 100% 0, rgba(244, 180, 0, .18), transparent 45%), linear-gradient(120deg, #0c2a52, #123c70); }
html.theme-dark .brand-prev { background: #09111d; }
html.theme-dark h1, html.theme-dark h2, html.theme-dark h3 { color: #d9e6f7; }
html.theme-dark a { color: #7fb3f0; }
html.theme-dark .side-nav a, html.theme-dark .brand { color: #c5d0e2; }
html.theme-dark .brand { color: #fff; }
html.theme-dark .kpi-row .kpi b, html.theme-dark .kpis .kpi b, html.theme-dark .mini-stats b, html.theme-dark .w-stat b, html.theme-dark .big-pct b { color: #d9e6f7; }

/* ---------------- responsive (tablet y móvil) ---------------- */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget.s3 { grid-column: 1 / -1; }
  .rep-layout, .filters-layout, .docs-layout, .files-layout { grid-template-columns: 1fr; }
  .rep-nav, .saved-filters, .docs-tree, .files-cats { position: static; max-height: none; }
  .rep-nav { display: flex; overflow-x: auto; gap: 4px; }
  .rep-nav a { flex: none; }
  .rep-nav small { display: none; }
  .files-cats { display: flex; overflow-x: auto; gap: 4px; }
  .files-cats a { flex: none; }
  .split, .risk-split, .form-builder { grid-template-columns: 1fr; }
  .md-split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .view-head { flex-direction: column; align-items: stretch; }
  .view-head .actions { flex-wrap: wrap; }
  .task-head { flex-wrap: wrap; gap: 6px; }
  .th-actions { flex-wrap: wrap; justify-content: flex-end; }
  .doc-title { font-size: 21px; }
  .view-opts { flex-wrap: wrap; }
  .view-opts label.opt select { min-width: 110px; }
  .bl-row.selectable { grid-template-columns: 16px 16px 20px auto minmax(0, 1fr) 24px; }
  .dash-grid { grid-template-columns: 1fr; }
  .widget.s2, .widget.s3 { grid-column: auto; }
  .hero-sm { padding: 18px; }
  .hero-sm h1 { font-size: 21px; }
  .fb-row { grid-template-columns: 1fr 1fr; }
  .fb-row .fb-v { grid-column: 1 / 2; }
  .abs-form { grid-template-columns: 1fr 1fr; }
  .perm-list { grid-template-columns: 1fr; }
  .kpi-row .kpi { flex-basis: calc(50% - 6px); }
  .filters-bar label > input, .filters-bar label > select { min-width: 0; width: 100%; }
  .filters-bar label { flex: 1 1 45%; }
  .search-in { max-width: none; }
  .timer-chip a b { display: none; }
  .view-tabs a span { display: none; }
  .view-tabs a { padding: 8px 10px; }
  .cal-days.week { grid-template-columns: repeat(7, 78vw); }
  .doc-view { padding: 16px; }
  .profile-head { gap: 12px; }
  .pf-row { grid-template-columns: 1fr; }
  .rm-row { grid-template-columns: 170px var(--w); }
  .rm { min-width: calc(170px + var(--w)); }
  .docs-hero { flex-direction: column; }
  .topbar button.search { width: auto; }
  .topbar button.search span, .topbar button.search kbd { display: none; }
}
@media print {
  .sidebar, .topbar, .view-tabs, .toolbar, .rep-nav, .filters-bar, .docs-tree, .timer-chip, .ctx-menu { display: none !important; }
  body.app { display: block; }
  .rep-layout, .docs-layout { display: block; }
}
.sum-grid > *, .grid-cards > *, .report-grid > * { min-width: 0; }

/* Modo oscuro: componentes de app.css con fondo claro fijo */
html.theme-dark .seg button.on, html.theme-dark .seg a.on { background: #22344f; color: #9cc2f0; }
html.theme-dark .col-head .count, html.theme-dark .cal-add, html.theme-dark .quick button, html.theme-dark .fitem, html.theme-dark .pchip,
html.theme-dark .bell-pop, html.theme-dark .rem-pop, html.theme-dark .tl-results, html.theme-dark .mention-pop, html.theme-dark .del-status .pop,
html.theme-dark .tpl-card, html.theme-dark .col-inline, html.theme-dark .group-head, html.theme-dark .mail-preview { background: var(--surface-2); color: var(--text); border-color: var(--line); }
html.theme-dark .g-header, html.theme-dark .g-header .g-track, html.theme-dark .g-label { background: var(--surface); }
html.theme-dark .bug-box { background: #2a1a20; border-color: #5a2328; }
html.theme-dark table.tasks tr.is-late { background: #2a1a20; }
html.theme-dark .bl-row:hover, html.theme-dark .col-add:hover, html.theme-dark .check-list .ctext:hover { background: #1c2b45; }
html.theme-dark .x:hover { background: #22344f; }
html.theme-dark .search kbd { background: var(--surface); }
html.theme-dark body.auth, html.theme-dark .auth-wrap { background: var(--bg); }
html.theme-dark .auth-card { background: var(--surface); color: var(--text); }
html.theme-dark .toggle span, html.theme-dark .switch > span { background: #33476a; }

/* =========================================================================
   v4.0.1 · ajustes de navegación, barras de desplazamiento y densidad
   ========================================================================= */
/* Barras de desplazamiento discretas en toda la aplicación */
* { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .35) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .32); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(100, 116, 139, .55); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }
.sidebar, .side-scroll { scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.sidebar ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); }

/* Pestañas: se acomodan en varias líneas en vez de mostrar una barra horizontal */
.tabs, .tabs-bar { flex-wrap: wrap; overflow: visible; row-gap: 0; }
.tabs a, .tabs-bar > a { padding: 9px 12px; }
.cfg-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cfg-tabs { margin-bottom: 18px; }
@media (max-width: 720px) {
  .tabs, .tabs-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .tabs::-webkit-scrollbar, .tabs-bar::-webkit-scrollbar { display: none; }
}

/* Barra lateral más compacta: todo el menú cabe en pantallas de 768 px */
.sidebar { padding: 10px 0; gap: 2px; }
.sidebar .brand { padding: 4px 18px 8px; }
.side-user { margin: 4px 12px 6px; padding: 8px 10px; }
.side-user .avatar { width: 30px; height: 30px; }
.side-title { padding: 6px 22px 3px; }
.side-nav a, .side-link { margin: 1px 10px; padding: 7px 12px; }
.side-nav a .ic, .side-link .ic { width: 17px; height: 17px; }
.side-foot { padding-top: 4px; padding-bottom: 2px; }
.side-foot .side-nav a { padding: 6px 12px; }
@media (max-height: 760px) {
  .side-nav a, .side-link { padding: 5px 12px; font-size: 13px; }
  .side-user { display: none; }
}
.form-builder > *, .split > *, .filters-layout > *, .docs-layout > *, .files-layout > *, .rep-layout > * { min-width: 0; }
.fb-item .row select { max-width: 100%; min-width: 0; flex: 1 1 140px; }
.row-flex.wrap { flex-wrap: wrap; }
@media (max-width: 720px) {
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  form.inline { flex-wrap: wrap; }
  .card-top { flex-wrap: wrap; }
}

/* v4.0.1 · detalles visuales */
.topbar button.search .ic { position: static; transform: none; flex: none; }
.filters-bar.inline-labels { align-items: center; }
.filters-bar.inline-labels > label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.filters-bar.inline-labels > label select { width: auto; min-width: 130px; }
.users-table select { width: 126px; min-width: 0; height: 32px; padding-top: 0; padding-bottom: 0; }
table.simple.users-table th, table.simple.users-table td { padding-left: 7px; padding-right: 7px; }
table.simple.users-table td:nth-child(2) { white-space: nowrap; }
.users-table select[name=status] { width: 102px; }
table.simple.users-table th { letter-spacing: .02em; }
.users-table td:last-child .btn + * { margin-left: 2px; }
.users-table .btn { padding-left: 10px; padding-right: 10px; }
.users-table td:last-child { white-space: nowrap; }
.users-table td:first-child { min-width: 150px; }

/* v4.1 · créditos */
.app-foot { margin: 28px 0 4px; padding-top: 14px; border-top: 1px solid var(--line-2); text-align: center; font-size: 11.5px; color: var(--muted); }
.app-foot a, .auth-card .foot a { color: inherit; font-weight: 600; text-decoration: none; }
.app-foot a:hover, .auth-card .foot a:hover { color: var(--primary, #0A3A73); text-decoration: underline; }

/* v4.1 · dashboard personalizable en vivo */
.dash-grid { --dg-gap: 16px; gap: var(--dg-gap); grid-auto-flow: row dense; }
.dash-grid.compact { --dg-gap: 10px; }
.dash-grid.compact .widget .card-top { margin-bottom: 6px; }
.dash-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-grid .widget.s2, .dash-grid .widget-ph.s2 { grid-column: span 2; }
.dash-grid .widget.s3, .dash-grid .widget-ph.s3 { grid-column: span 3; }
.dash-grid .widget.s4, .dash-grid .widget-ph.s4, .dash-grid .s4 { grid-column: 1 / -1; }
.dash-grid.c2 .widget.s3, .dash-grid.c2 .widget-ph.s3 { grid-column: 1 / -1; }
.dash-grid .widget.h1 .wbody { height: 180px; overflow: auto; }
.dash-grid .widget.h2 .wbody { height: 300px; overflow: auto; }
.dash-grid .widget.h3 .wbody { height: 440px; overflow: auto; }
.dash-grid .widget.h1 .chart-box, .dash-grid .widget.h2 .chart-box, .dash-grid .widget.h3 .chart-box { height: calc(100% - 4px); }
.widget .whead { gap: 8px; }
.widget .w-grip { width: 22px; height: 22px; border-radius: 6px; cursor: grab; touch-action: none; margin-left: -6px; opacity: .35; transition: opacity .15s, background .15s; }
.widget:hover .w-grip, .w-grip:focus-visible, .dash-customizing .w-grip { opacity: 1; }
.w-grip:hover { background: var(--surface-2); color: var(--text); }
.w-grip:focus-visible { outline: 2px solid var(--primary); }
.widget { position: relative; }
.wtools { position: absolute; top: 10px; right: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(10, 30, 70, .12); opacity: 0; pointer-events: none; transition: opacity .15s; }
.widget:hover .wtools, .widget:focus-within .wtools { opacity: 1; pointer-events: auto; }
.wtools .icon-btn { width: 28px; height: 28px; }
@media (hover: none) { .wtools { position: static; opacity: 1; pointer-events: auto; box-shadow: none; border: 0; padding: 0; } .widget .w-grip { opacity: 1; } }
.wsizes { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; margin-right: 4px; }
.wsizes button { border: 0; background: var(--surface); color: var(--muted); font: 600 10.5px var(--font); padding: 3px 6px; cursor: pointer; }
.wsizes button + button { border-left: 1px solid var(--line); }
.wsizes button.on { background: var(--primary); color: #fff; }
.wsizes button:hover:not(.on) { background: var(--surface-2); color: var(--text); }
.widget.collapsed .wbody { display: none; }
.widget.collapsed { align-self: start; }
.widget.collapsed .card-top { margin-bottom: 0; }
.widget .wcfg { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.dash-customizing .dash-grid .widget { outline: 2px dashed #bcd0ea; outline-offset: 3px; }
.dash-customizing .dash-grid .whead { cursor: grab; }
.widget.w-dragging { box-shadow: 0 24px 60px rgba(10, 30, 70, .28); transform: rotate(.6deg) scale(1.01); opacity: .96; cursor: grabbing; }
.dash-dragging, .dash-dragging * { cursor: grabbing !important; user-select: none; }
.widget-ph { border: 2px dashed var(--primary); border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 6%, transparent); min-height: 110px; }
.widget-ph.new { display: grid; place-items: center; color: var(--primary); font-size: 13px; min-height: 120px; }
.widget.w-new { animation: wNew 1.4s ease; }
@keyframes wNew { 0% { box-shadow: 0 0 0 0 rgba(244, 180, 0, .7); } 40% { box-shadow: 0 0 0 6px rgba(244, 180, 0, .35); } 100% { box-shadow: var(--shadow); } }
.dash-dropping .dash-grid { outline: 2px dashed color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 8px; border-radius: 14px; }
.hero .btn.primary { background: #fff; color: var(--primary); border-color: #fff; }
.hero .btn.primary:hover { background: #f1f5fb; }

/* Pestañas de dashboards */
.dash-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.dtab { display: inline-flex; align-items: center; gap: 7px; max-width: 240px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; }
.dtab .ic { width: 15px; height: 15px; flex: none; }
.dtab:hover { border-color: #c3cfe2; color: var(--text); }
.dtab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.dtab.add { border-style: dashed; padding: 7px 10px; font: inherit; }
.dtab.dragging { opacity: .45; }
.dtab .home-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent, #F4B400); flex: none; }

/* Panel «Personalizar» */
.dash-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 100%; z-index: 900; background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(10, 30, 70, .14); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .24s cubic-bezier(.2, .7, .3, 1); visibility: hidden; }
.dash-drawer.open { transform: none; visibility: visible; }
.dash-drawer header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.dash-drawer header b { display: block; font-size: 16px; }
.dash-drawer header small { display: block; }
.dash-drawer .dd-tabs { margin: 0 18px 10px; display: flex; }
.dash-drawer .dd-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.dash-drawer .dd-pane { padding: 4px 18px 24px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.dash-drawer .dd-pane[hidden] { display: none; }
.dash-drawer .search-in { max-width: none; }
.wp-group { display: flex; flex-direction: column; gap: 6px; }
.wp-group .side-title { margin: 8px 0 0; color: var(--muted); }
.dash-drawer .wp-item { display: flex; align-items: center; gap: 10px; cursor: grab; user-select: none; padding: 9px 8px 9px 10px; }
.dash-drawer .wp-item:active { cursor: grabbing; }
.dash-drawer .wp-item.dragging { opacity: .5; }
.dash-drawer .wp-item b { display: block; font-size: 13px; }
.dash-drawer .wp-item small { font-size: 11.5px; line-height: 1.35; }
.wp-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.dash-drawer .wp-add { flex: none; min-height: 0; border: 1px solid var(--line); border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; background: var(--surface); color: var(--primary); }
.dash-drawer .wp-add:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.dd-help p { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); margin: 6px 0; }
.dd-help .ic { flex: none; margin-top: 2px; color: var(--muted); }
@media (min-width: 1100px) { body.dash-customizing .main { padding-right: 360px; transition: padding .24s; } }
.undo-bar { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; z-index: 1200; display: flex; align-items: center; gap: 14px; background: #0f1b2d; color: #fff;
  padding: 10px 12px 10px 18px; border-radius: 12px; box-shadow: 0 12px 34px rgba(0, 0, 0, .3); font-size: 13.5px; transition: all .22s; }
.undo-bar.show { opacity: 1; transform: translate(-50%, 0); }
.undo-bar .btn { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
@media (max-width: 1100px) { .dash-grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-grid.c4 .widget.s3, .dash-grid.c3 .widget.s3 { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .dash-grid.c2, .dash-grid.c3, .dash-grid.c4 { grid-template-columns: 1fr; }
  .dash-grid .widget.s2, .dash-grid .widget.s3, .dash-grid .widget-ph { grid-column: auto; }
  .dash-drawer { top: auto; height: 78vh; width: 100%; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; transform: translateY(105%); }
  .wsizes { display: none; }
}
html.theme-dark .dash-drawer { box-shadow: -18px 0 50px rgba(0, 0, 0, .45); }
html.theme-dark .undo-bar { background: #e2e8f0; color: #0f172a; }
html.theme-dark .undo-bar .btn { background: rgba(0, 0, 0, .08); color: #0f172a; border-color: rgba(0, 0, 0, .2); }
.widget .time-row { grid-template-columns: minmax(0, 1.3fr) minmax(40px, 1fr) auto; }
.widget .time-row > * { min-width: 0; }

/* v4.1 · exportar Gantt */
.fmt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 12px; }
.fmt-opt { margin: 0; cursor: pointer; }
.fmt-opt input { position: absolute; opacity: 0; pointer-events: none; }
.fmt-opt span { display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; height: 100%; }
.fmt-opt span .ic { grid-row: span 2; width: 22px; height: 22px; color: var(--primary); }
.fmt-opt b { font-size: 13px; }
.fmt-opt small { color: var(--muted); font-size: 11.5px; line-height: 1.35; font-weight: 400; }
.fmt-opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.fmt-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
#dlgGanttExp { width: min(680px, 96vw); }
#dlgGanttExp h2 .ic { margin-right: 6px; vertical-align: -3px; }

/* v4.1 · informes combinados */
.rep-nav a.rep-all { background: var(--primary-soft); border: 1px dashed color-mix(in srgb, var(--primary) 35%, transparent); margin-bottom: 6px; }
.rep-nav a.rep-all.on { background: var(--primary); color: #fff; }
.rep-nav a.rep-all.on small { color: rgba(255, 255, 255, .8); }
.rep-nav a.in { box-shadow: inset 3px 0 0 var(--accent, #F4B400); }
.rep-multi-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.rep-multi-head h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; margin: 0; }
.rep-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rep-toc .chip { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.rep-toc .chip .ic { width: 13px; height: 13px; }
.rep-block { scroll-margin-top: 80px; }
.rep-block + .rep-block { margin-top: 30px; padding-top: 22px; border-top: 2px solid var(--line); }
.rep-title small { display: block; font-size: 12.5px; font-weight: 400; margin-top: 2px; }
.tpl-all { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--primary); background: var(--primary-soft); border-radius: 12px; margin: 6px 0 10px; cursor: pointer; }
.tpl-all b { display: block; } .tpl-all small { color: var(--muted); }
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tpl-opt { margin: 0; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; }
.tpl-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.tpl-opt input { margin-top: 3px; flex: none; }
.tpl-opt span { display: grid; grid-template-columns: 18px 1fr; column-gap: 6px; }
.tpl-opt span .ic { width: 16px; height: 16px; color: var(--primary); margin-top: 1px; }
.tpl-opt b { font-size: 13px; } .tpl-opt small { grid-column: 2; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.tpl-count { align-self: end; padding-bottom: 10px; }
#dlgGen { width: min(760px, 96vw); }
@media print { .rep-block { break-before: page; } .rep-block:first-of-type { break-before: auto; } .rep-nav, .filters-bar, .rep-multi-head .actions { display: none !important; } }
.rep-block .rep-title { flex-wrap: wrap; } .rep-block .rep-title small { flex-basis: 100%; margin-left: 30px; }

/* v4.1 · ciclo de vida del software */
.sd-head h1 { display: flex; align-items: center; gap: 8px; }
.sd-total { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.health { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.health::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.health.h-ok { background: #e8f1fd; color: #1f62b8; } .health.h-risk { background: #fff3e0; color: #b45309; } .health.h-late { background: #fdecea; color: #c0392b; }
.health.h-done { background: #e7f6ec; color: #1e874b; } .health.h-none { background: #eef1f6; color: #64748b; }
.sd-st { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: #eef1f6; color: #475467; }
.sd-st .ic { width: 13px; height: 13px; }
.sd-st.st-en_curso { background: #e8f1fd; color: #1f62b8; } .sd-st.st-en_revision { background: #f2ecfb; color: #6b3fb0; } .sd-st.st-aprobada { background: #e7f6ec; color: #1e874b; }
.sd-st.st-bloqueada { background: #fdecea; color: #c0392b; } .sd-st.st-omitida { background: #f1f2f4; color: #6b7280; }
.sd-pipe { display: flex; gap: 0; overflow-x: auto; padding: 4px 2px 14px; margin-bottom: 14px; scrollbar-width: thin; }
.sd-step { position: relative; flex: 1 1 0; min-width: 150px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px 12px 10px; color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-right: 18px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.sd-step:hover { transform: translateY(-1px); text-decoration: none; box-shadow: 0 8px 20px rgba(10, 30, 70, .1); }
.sd-step:not(:last-child)::after { content: ""; position: absolute; right: -16px; top: 50%; width: 14px; height: 2px; background: var(--line); }
.sd-step.st-aprobada:not(:last-child)::after { background: #27AE60; }
.sd-step.cur { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 25%, transparent), var(--shadow); }
.sd-step.sel { background: color-mix(in srgb, var(--c) 7%, var(--surface)); }
.sd-ring { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #e7ebf2 0); }
.sd-ring > span { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--c); }
.sd-ring .ic { width: 16px; height: 16px; }
.sd-step.st-aprobada .sd-ring > span { background: #27AE60; color: #fff; }
.sd-step.st-bloqueada .sd-ring > span { background: #fdecea; color: #c0392b; }
.sd-step-t { display: flex; flex-direction: column; min-width: 0; }
.sd-step-t b { font-size: 13px; line-height: 1.3; }
.sd-step-t small { color: var(--muted); font-size: 11.5px; }
.sd-gates-mini { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sd-gates-mini .ic { width: 12px; height: 12px; }
.sd-gates-mini .health { font-size: 10.5px; padding: 0 6px; }
.sd-split { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
.sd-cur { border-top: 4px solid var(--c); }
.sd-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.sd-kv dd .progress { max-width: 240px; }
.sd-gatelist { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; }
.sd-gate { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line-2); }
.sd-gate:last-child { border-bottom: 0; }
.sd-gate b { display: block; font-size: 13px; }
.sd-gate small { display: block; font-size: 12px; }
.g-ok, .g-ko, .g-na { display: grid; place-items: center; flex: none; }
.g-ok .ic { color: #27AE60; width: 20px; height: 20px; } .g-ko .ic { color: #E0533D; width: 20px; height: 20px; } .g-na .ic { color: #98A2B3; width: 20px; height: 20px; }
.sd-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sd-add > input, .sd-add > select { flex: 1 1 160px; width: auto; height: 34px; }
.sd-deliv { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; }
.sd-deliv li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-2); }
.sd-deliv li.done b { text-decoration: line-through; color: var(--muted); }
.sd-deliv .chip { margin-left: 4px; text-decoration: none; }
.chkbox { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #c3cfe2; background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; color: #fff; flex: none; }
.chkbox.on { background: #27AE60; border-color: #27AE60; }
.chkbox .ic { width: 13px; height: 13px; }
.sd-rule { margin-top: 10px; }
.sd-rule summary { list-style: none; display: inline-flex; }
.sd-rule summary::-webkit-details-marker { display: none; }
.sd-rule select[multiple] { height: auto; }
.sd-phase-head { border-top: 4px solid var(--c); }
.sd-phase-head h2 { margin: 0; }
.sd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.sd-facts > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.sd-facts small { display: block; color: var(--muted); font-size: 11.5px; }
.sd-facts b { font-size: 13.5px; }
.sd-facts .progress { margin-top: 6px; }
.sd-tl { position: relative; display: flex; flex-direction: column; gap: 6px; }
.sd-tl-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.sd-tl-track { position: relative; height: 22px; background: var(--surface-2); border-radius: 6px; }
.sd-tl-track i { position: absolute; top: 3px; height: 16px; border-radius: 5px; }
.sd-tl-track i.plan { background: color-mix(in srgb, var(--c) 22%, transparent); border: 1px dashed color-mix(in srgb, var(--c) 60%, transparent); }
.sd-tl-track i.real { top: 7px; height: 8px; background: var(--c); }
.sd-today { position: absolute; top: 0; bottom: 18px; width: 2px; background: #E0533D; z-index: 2; }
.sd-tl-axis { display: flex; justify-content: space-between; margin-left: 160px; font-size: 11px; color: var(--muted); }
.sd-envs { display: flex; flex-direction: column; gap: 8px; }
.sd-env { border-left: 4px solid var(--c); padding: 6px 10px; background: var(--surface-2); border-radius: 0 8px 8px 0; display: flex; flex-direction: column; }
.sd-env b { display: flex; align-items: center; gap: 4px; font-size: 13px; } .sd-env b .ic { width: 13px; height: 13px; color: var(--muted); }
.sd-env small { font-size: 11.5px; color: var(--muted); }
.dep-st { font-weight: 700; } .dep-st.ds-exitoso { color: #1e874b; } .dep-st.ds-fallido { color: #c0392b; } .dep-st.ds-en_curso { color: #1f62b8; } .dep-st.ds-revertido { color: #b45309; }
.sd-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sd-log li { display: flex; gap: 10px; font-size: 13px; }
.sd-log li small { display: block; }
.sd-log i { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 5px; background: #94A3B8; }
.sd-log i.k-approved, .sd-log i.k-approval, .sd-log i.k-completed { background: #27AE60; } .sd-log i.k-rejected, .sd-log i.k-blocked, .sd-log i.k-ci_failed { background: #E0533D; }
.sd-log i.k-start, .sd-log i.k-init { background: #2F80D1; } .sd-log i.k-submit { background: #8E5BD0; } .sd-log i.k-deploy { background: #F4B400; }
.sd-envboard { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 18px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.sd-envcol { position: relative; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.sd-envcol header { display: flex; align-items: center; gap: 6px; } .sd-envcol header b { flex: 1; }
.sd-arrow { position: absolute; right: -17px; top: 40%; color: var(--muted); }
.sd-dep { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.sd-dep.ds-fallido { border-color: #f2b8b0; background: #fff7f6; } .sd-dep.ds-revertido { border-color: #f6d3a8; }
.sd-dep small { font-size: 11.5px; }
.sd-envedit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.sd-envedit input[type=color] { width: 34px; height: 30px; padding: 2px; flex: none; }
.sd-envedit input:not([type=color]):not([type=checkbox]) { flex: 1 1 90px; height: 32px; width: auto; }
.sd-phaselist { list-style: none; padding: 0; margin: 0; }
.sd-phaselist li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.sd-phaselist li > i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sd-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 12px; }
.sd-model { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.sd-model h4 { margin: 0; font-size: 15px; }
.sd-model-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sd-model-steps li { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; font-size: 13px; }
.sd-model-steps li i { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.sd-model-steps small { grid-column: 2; color: var(--muted); font-size: 11px; }
.sd-mini { display: flex; gap: 3px; } .sd-mini i { width: 18px; height: 8px; border-radius: 3px; background: #e7ebf2; }
.sd-mini i.st-aprobada { background: #27AE60; } .sd-mini i.st-en_curso, .sd-mini i.st-en_revision { background: var(--c); } .sd-mini i.st-bloqueada { background: #E0533D; } .sd-mini i.st-omitida { background: #c7ccd4; }
.sd-pending { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line-2); color: var(--text); text-decoration: none; }
.sd-pending:hover { background: var(--surface-2); text-decoration: none; }
.sd-trace td .ok, .sd-trace .ok { color: #1e874b; font-weight: 600; }
.chip .dot, .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.kpi b.warn, td.warn, span.warn { color: #b45309; } .kpi b.bad, td.bad, span.bad, .bad { color: #c0392b; } span.ok, td.ok, small.ok { color: #1e874b; }
.alert.warn { background: #fff7e8; border-color: #f6d3a8; color: #8a4b0b; }
@media (max-width: 1100px) { .sd-split, .code-split { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .sd-tl-row { grid-template-columns: 90px 1fr; } .sd-tl-axis { margin-left: 100px; } .sd-step { min-width: 180px; } }

/* v4.1 · código y evaluación (GitHub) */
.page-head h1 .ic { width: 22px; height: 22px; vertical-align: -3px; }
.code-split { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.6fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.code-filter select { width: auto; height: 36px; }
.eng-big { display: flex; gap: 16px; align-items: center; margin: 6px 0 12px; }
.eng-ring { --c: #2F80D1; width: 108px; height: 108px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #e7ebf2 0); position: relative; }
.eng-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.eng-ring b, .eng-ring small { position: relative; } .eng-ring b { font-size: 30px; line-height: 1; } .eng-ring small { position: absolute; bottom: 28px; font-size: 11px; color: var(--muted); }
.lv-elite .eng-ring { --c: #27AE60; } .lv-high .eng-ring { --c: #2F80D1; } .lv-medium .eng-ring { --c: #F4B400; } .lv-low .eng-ring { --c: #E0533D; }
.eng-grade { display: inline-block; font-weight: 800; font-size: 20px; color: var(--primary); }
.eng-parts > div { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 32px; gap: 8px; align-items: center; font-size: 12.5px; padding: 4px 0; }
.eng-parts b { text-align: right; }
.eng-tips { margin-top: 12px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.eng-tips b { display: flex; align-items: center; gap: 6px; } .eng-tips ul { margin: 6px 0 0 18px; padding: 0; }
.eng-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.eng-kpis .kpi { flex-direction: column; align-items: flex-start; gap: 2px; }
.eng-kpis.sm { grid-template-columns: repeat(6, minmax(0, 1fr)); } .eng-kpis.sm .kpi b { font-size: 18px; }
.pr-st, .ci-st { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #eef1f6; color: #475467; white-space: nowrap; }
.pr-st.pr-open { background: #e7f6ec; color: #1e874b; } .pr-st.pr-merged { background: #f2ecfb; color: #6b3fb0; } .pr-st.pr-closed { background: #fdecea; color: #c0392b; }
.ci-st.ci-success { background: #e7f6ec; color: #1e874b; } .ci-st.ci-failure, .ci-st.ci-timed_out, .ci-st.ci-startup_failure { background: #fdecea; color: #c0392b; } .ci-st.ci-in_progress, .ci-st.ci-queued { background: #e8f1fd; color: #1f62b8; }
.code-seg { margin-bottom: 12px; display: inline-flex; } .code-seg a { text-decoration: none; }
.copy-row { display: flex; gap: 6px; } .copy-row input { flex: 1; }
@media (max-width: 1100px) { .eng-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .eng-kpis.sm { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
html.theme-dark .sd-st, html.theme-dark .health, html.theme-dark .pr-st, html.theme-dark .ci-st { filter: brightness(.9) saturate(1.1); }
html.theme-dark .sd-dep.ds-fallido { background: rgba(224, 83, 61, .08); }
html.theme-dark .sd-ring { background: conic-gradient(var(--c) calc(var(--p) * 1%), #2a3446 0); }
html.theme-dark .eng-ring { background: conic-gradient(var(--c) calc(var(--p) * 1%), #2a3446 0); }
.kpi-row.eng-kpis { display: grid; }
.seg a { padding: 5px 11px; border-radius: 6px; font-size: 12.5px; font-weight: 550; color: var(--muted); }
.seg a.on { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
html.theme-dark .seg a.on { background: var(--surface); }
.form-card .chk, label.chk { white-space: normal; }
.sd-envedit { display: grid; grid-template-columns: 34px minmax(0, 1fr) 72px 30px 30px 30px; gap: 6px; align-items: center; }
.sd-envedit > input[name=url] { grid-column: 2 / -1; grid-row: 2; }
.sd-envedit > .chk { margin: 0; display: grid; place-items: center; }
.sd-envedit > .chk input { position: absolute; opacity: 0; }
.sd-envedit > .chk .ic { width: 16px; height: 16px; color: #98A2B3; cursor: pointer; }
.sd-envedit > .chk:has(input:checked) .ic { color: var(--primary); }
.sd-envedit input:not([type=color]):not([type=checkbox]) { width: 100%; }
.sd-envedit .btn.sm { padding: 0; width: 30px; height: 30px; justify-content: center; }
select[multiple] { height: auto; min-height: 92px; padding: 4px; }
.w-sdlc { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 40px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); color: var(--text); text-decoration: none; font-size: 13px; }
.w-sdlc:hover { text-decoration: none; background: var(--surface-2); }
.w-sdlc small { display: block; } .w-sdlc > b { text-align: right; }
.w-eng { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; margin-bottom: 10px; }
.w-eng .eng-ring { width: 70px; height: 70px; } .w-eng .eng-ring::before { inset: 7px; } .w-eng .eng-ring b { font-size: 20px; }
.w-eng small { display: block; }
.w-eng-k { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.w-eng-k > div { background: var(--surface-2); border-radius: 9px; padding: 8px; } .w-eng-k b { display: block; font-size: 15px; } .w-eng-k small { color: var(--muted); font-size: 11px; }
.eng-kpis .kpi { min-width: 0; } .eng-kpis .kpi small, .eng-kpis .kpi b { overflow-wrap: anywhere; }
.code-split code, .code-split li, #webhooks code { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 760px) { .eng-kpis.sm { grid-template-columns: repeat(2, minmax(0, 1fr)); } .eng-big { flex-wrap: wrap; } .copy-row { flex-wrap: wrap; } }
@media (max-width: 1100px) { .code-split, .sd-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .card-top > .muted.small { flex-basis: 100%; order: 9; } }
html.theme-dark .sd-ring > span { color: color-mix(in srgb, var(--c) 55%, #fff); }

/* v4.1.1 · contraste: los campos nunca heredan el texto blanco de barras oscuras */
option, optgroup { color: #15202E; background: #fff; }
html.theme-dark option, html.theme-dark optgroup { color: var(--text); background: #0f1928; }
.bulk-bar select, .bulk-bar input { color: var(--text); background: #fff; border-color: rgba(255, 255, 255, .35); height: 32px; }
.bulk-bar select { max-width: 170px; }
.bulk-bar .bulk-date .ic { color: rgba(255, 255, 255, .8); }
.bulk-bar input[type=date]::-webkit-calendar-picker-indicator { opacity: .7; }
html.theme-dark .bulk-bar { background: #13223a; border: 1px solid #2b3c58; }
html.theme-dark .bulk-bar select, html.theme-dark .bulk-bar input { background: #0f1928; color: var(--text); }
.cell.s2, .risk-score.s2 { color: #3d2c00; }
.pts.na { color: #a3adbd; }
.prio-sel.p-media { color: #946f00; }
.cal-day.out .cal-num { color: #98a2b3; }
.rep-nav a.rep-all.on small { color: #fff; }
/* modo oscuro: superficies claras heredadas del tema claro */
html.theme-dark table.tasks tbody tr:hover, html.theme-dark .g-label:hover { background: #18253a; }
html.theme-dark tr.is-sel td { background: #16304f !important; }
html.theme-dark .alert.info { background: #12294a; border-color: #24426b; color: #b9d6fb; }
html.theme-dark .cat-pts .c-todo { background: #26354d; color: #c7d2e3; }
html.theme-dark .cat-pts .c-progress { background: #17345e; color: #9cc2f0; }
html.theme-dark .cat-pts .c-done { background: #163d2c; color: #8fe0b4; }
html.theme-dark .cal-mark { background: #17345e; color: #9cc2f0; }
html.theme-dark .cal-mark.end { background: #3a3113; color: #f1cc7a; }
html.theme-dark .cal-mark.ver { background: #2c2350; color: #c4b2ff; }
html.theme-dark .prio-sel.p-media, html.theme-dark .p-media { color: #f1cc7a; }
html.theme-dark .cal-day.out .cal-num { color: #6b7a93; }
html.theme-dark .pts.na { color: #5d6b82; }
html.theme-dark .mchip.dev { color: #b79cff; }
html.theme-dark .alert.warn { background: #2e2512; }
@media (max-width: 760px) { .cal-nav { flex-wrap: wrap; } .cal-nav h3 { min-width: 0; } .cal-nav .muted.small { flex-basis: 100%; } }

/* v4.1.2 · Centro de ayuda (pages/help.php, lib/help.php, help/*.md) */
.hl-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 460px); gap: 14px 28px; align-items: center; padding: 22px 26px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--surface) 55%, var(--primary-soft)); }
.hl-hero h1 { font-size: 24px; margin: 4px 0 4px; }
.hl-hero p { max-width: 62ch; }
.hl-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-d); }
.hl-search { position: relative; display: flex; align-items: center; }
.hl-search > .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.hl-search input { width: 100%; height: 46px; padding: 0 44px 0 42px; border-radius: 12px; font-size: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-m); }
.hl-search input:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
.hl-search kbd { position: absolute; right: 12px; }
.hl-quick { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.chip-link:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.hl-layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 16px; align-items: start; }
.hl-layout > * { min-width: 0; }
.hl-nav { padding: 8px; position: sticky; top: 74px; max-height: calc(100vh - 96px); overflow-y: auto; }
.hl-nav-sum { list-style: none; display: none; align-items: center; gap: 8px; padding: 8px 10px; font-weight: 650; cursor: pointer; }
.hl-nav-sum::-webkit-details-marker { display: none; }
.hl-nav-sum .muted { margin-left: auto; font-weight: 500; }
.hl-nav a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--text-2); font-size: 13px; }
.hl-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.hl-nav a.on { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.hl-nav-cat { display: flex; align-items: center; gap: 7px; margin: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.hl-nav-cat .ic { width: 13px; height: 13px; }
.hl-aud { margin-left: auto; color: var(--gold-d); display: inline-flex; }

.hl-role { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px; }
.hl-role p { margin: 2px 0 0; }
.hl-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.hl-cat { margin: 0; padding: 16px 18px; }
.hl-cat header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hl-cat header h2 { font-size: 15.5px; flex: 1; }
.hl-cat-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.hl-cat-ic.lg { width: 48px; height: 48px; border-radius: 14px; }
.hl-cat-ic.lg .ic { width: 22px; height: 22px; }
.hl-cat ul { list-style: none; margin: 0; padding: 0; }
.hl-cat li a { display: block; padding: 8px 10px; margin: 0 -10px; border-radius: 9px; color: var(--text); }
.hl-cat li a:hover { background: var(--surface-2); text-decoration: none; }
.hl-cat li a b { font-weight: 600; color: var(--navy); }
.hl-cat li small { display: block; margin-top: 1px; line-height: 1.4; }
.chip.xs { font-size: 10.5px; padding: 1px 7px; vertical-align: 1px; }
.chip.gold-chip { background: var(--gold-soft); color: var(--warn); }
.hl-foot { margin: 22px 0 6px; }

.hl-article-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.hl-article-wrap.with-toc { grid-template-columns: minmax(0, 1fr) 220px; }
.hl-article { margin: 0; padding: 24px 30px 18px; min-width: 0; }
.hl-art-head { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 16px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.hl-art-head h1 { font-size: 23px; margin: 6px 0 2px; }
.hl-art-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hl-art-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.hl-body { font-size: 14.2px; max-width: 78ch; }
.hl-body h3 { font-size: 18px; margin: 26px 0 8px; scroll-margin-top: 84px; }
.hl-body h4 { font-size: 15px; margin: 18px 0 6px; scroll-margin-top: 84px; color: var(--navy); }
.hl-body ol, .hl-body ul { padding-left: 22px; margin: 6px 0 10px; }
.hl-body li { margin: 3px 0; }
.hl-body li::marker { color: var(--primary); font-weight: 650; }
.hl-body p { margin: 8px 0; }
.hl-anchor { margin-left: 8px; color: var(--muted); opacity: 0; font-weight: 500; text-decoration: none; }
.hl-body h3:hover .hl-anchor, .hl-body h4:hover .hl-anchor { opacity: 1; }
.hl-body blockquote { margin: 12px 0; padding: 10px 14px; border-radius: 0 10px 10px 0; }
.hl-body blockquote.hl-tip { border-left-color: var(--ok); background: var(--ok-soft); }
.hl-body blockquote.hl-warn { border-left-color: var(--bad); background: var(--bad-soft); }
.hl-body blockquote.hl-q-role { border-left-color: var(--primary); background: var(--primary-soft); }
.hl-body table.hl-table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 13px; display: block; overflow-x: auto; }
.hl-body table.hl-table td { border: 1px solid var(--line); padding: 7px 10px; vertical-align: top; }
.hl-body table.hl-table tr.hl-th td { background: var(--surface-2); font-weight: 650; color: var(--navy); white-space: nowrap; }
.hl-body kbd, .hl-search kbd { font-size: 11px; }
.hl-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.hl-pg { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); }
.hl-pg:hover { border-color: var(--primary); text-decoration: none; }
.hl-pg small { display: inline-flex; align-items: center; gap: 4px; }
.hl-pg.next { text-align: right; align-items: flex-end; grid-column: 2; }
.hl-toc { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 2px; padding: 4px 0 4px 14px; border-left: 2px solid var(--line); }
.hl-toc b { margin-bottom: 6px; color: var(--navy); }
.hl-toc a { font-size: 12.5px; color: var(--muted); padding: 3px 0; line-height: 1.35; }
.hl-toc a.lv4 { padding-left: 12px; }
.hl-toc a:hover, .hl-toc a.on { color: var(--primary); text-decoration: none; }
.hl-toc a.on { font-weight: 650; }

.hl-results { display: flex; flex-direction: column; gap: 10px; }
.hl-res-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px; }
.hl-res-head .link-btn { margin-left: auto; }
.hl-hit { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 16px; color: var(--text); }
.hl-hit:hover { border-color: var(--primary); text-decoration: none; }
.hl-hit small { display: block; }
.hl-hit > .ic { margin-top: 8px; color: var(--muted); }
.hl-snip { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.hl-snip mark, .hl-hit mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

html.theme-dark .hl-hero { background: linear-gradient(135deg, var(--surface) 55%, #16304f); }
html.theme-dark .hl-search input { background: #0f1928; }
html.theme-dark .chip.gold-chip { color: #e8c35a; }
html.theme-dark .hl-body blockquote.hl-tip { background: #133524; }
html.theme-dark .hl-snip mark { background: #4a3c12; }

@media (max-width: 1180px) { .hl-article-wrap.with-toc { grid-template-columns: minmax(0, 1fr); } .hl-toc { display: none; } }
@media (max-width: 900px) {
  .hl-hero { grid-template-columns: 1fr; padding: 18px; }
  .hl-layout { grid-template-columns: 1fr; }
  .hl-nav { position: static; max-height: none; }
  .hl-nav-sum { display: flex; }
  .hl-nav-box:not([open]) > :not(summary) { display: none; }
  .hl-article { padding: 18px 16px 14px; }
  .hl-art-head { flex-wrap: wrap; }
  .hl-art-head .hl-cat-ic.lg { display: none; }
  .hl-cats { grid-template-columns: 1fr; }
  .hl-role { flex-wrap: wrap; } .hl-role .grow { flex-basis: calc(100% - 60px); } .hl-role .btn { margin-left: 50px; }
  .hl-pager { grid-template-columns: 1fr; } .hl-pg.next { grid-column: 1; }
}
@media print {
  .hl-hero, .hl-nav, .hl-toc, .hl-pager, .hl-art-actions, .app-foot { display: none !important; }
  .hl-layout, .hl-article-wrap { display: block; }
  .hl-article { border: 0; box-shadow: none; padding: 0; }
  .hl-body { max-width: none; }
}
.hl-hero.compact { padding: 12px 18px; grid-template-columns: auto minmax(260px, 520px); justify-content: space-between; }
.hl-hero.compact .hl-search input { height: 40px; box-shadow: none; }
@media (max-width: 900px) { .hl-hero.compact { grid-template-columns: 1fr; gap: 8px; } }
