:root {
  --bg: #eaeaea;
  --canvas: #f3f2f1;
  --card: #ffffff;
  --ink: #252423;
  --ink-2: #605e5c;
  --ink-3: #8a8886;
  --line: #e1dfdd;
  --accent: #2e74b5;
  --accent-soft: #dbe8f5;
  --yellow: #f2c811;
  --top: #1b1a19;
  --top-ink: #f3f2f1;
  --bar: #ffffff;
  --dim: .22;
  --good: #107c10;
  --shadow: 0 1px 2px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.05);
  --s1: #2e74b5; --s2: #f2c811; --s3: #e66c37; --s4: #6b007b; --s5: #118dff; --s6: #744ec2;
  --c1: #2e74b5; --c2: #0f8a78; --c3: #d45a1f; --c4: #7b3fb5; --c5: #a87600; --c6: #c2185b;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111; --canvas: #1b1a19; --card: #252423; --ink: #f3f2f1; --ink-2: #c8c6c4; --ink-3: #979593;
  --line: #3b3a39; --accent: #6ea8e0; --accent-soft: #1f3a55; --top: #0b0b0b; --bar: #201f1e;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --s1: #6ea8e0; --s5: #4aa8ff; --s4: #c86ad6; --s6: #a68bea; --c1: #6ea8e0; --c2: #3cc9b5; --c3: #f08a4b; --c4: #b48cf0; --c5: #f2c811; --c6: #f06aa0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { overflow-x: hidden; }
body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: #a19f9d; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- chrome ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 16px;
  background: var(--top); color: var(--top-ink);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: grid; place-items: center; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
.crumbs strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.badge { font-size: 11px; font-weight: 600; background: var(--yellow); color: #252423; padding: 1px 7px; border-radius: 10px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.refreshed { font-size: 12px; color: #a19f9d; }
.avatar img { width: 30px; height: 30px; border-radius: 50%; display: block; object-fit: cover; border: 2px solid #3b3a39; }

.actionbar {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: var(--bar); border-bottom: 1px solid var(--line);
  position: sticky; top: 48px; z-index: 19;
  overflow-x: auto; scrollbar-width: none;
}
.actionbar::-webkit-scrollbar { display: none; }
.act {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 4px; border: 0; background: none;
  font-size: 13px; color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.act:hover { background: var(--canvas); }
.act[hidden] { display: none; }
.act.spin svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spacer { flex: 1; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 30px; height: 16px; border-radius: 8px; background: var(--line); position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s; }
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(14px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.workspace { flex: 1; display: flex; min-height: 0; }
.canvas { flex: 1; min-width: 0; padding: 20px; }

.filters {
  width: 250px; flex-shrink: 0; background: var(--bar); border-left: 1px solid var(--line);
  padding: 14px 16px; position: sticky; top: 94px; align-self: flex-start;
  max-height: calc(100vh - 94px - 44px); overflow-y: auto;
}
.filters.closed, .filters.na { display: none; }
.f-head { display: flex; align-items: center; justify-content: space-between; }
.f-head h2 { font-size: 15px; margin: 0; font-weight: 600; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 12.5px; padding: 2px 4px; }
.f-label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.f-note { font-size: 12.5px; color: var(--ink-3); margin-top: 14px; }
.slicer { display: flex; flex-direction: column; gap: 2px; }
.slicer button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; padding: 5px 6px; border-radius: 3px; cursor: pointer; text-align: left; font-size: 13px;
}
.slicer button::before {
  content: ""; width: 14px; height: 14px; flex-shrink: 0; border: 1.5px solid var(--ink-3); border-radius: 2px;
}
.slicer button[aria-pressed="true"]::before { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 2.5px var(--card); }
.slicer button:hover { background: var(--canvas); }
.slicer .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; vertical-align: 1px; }
.slicer .n { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.tabs {
  display: flex; gap: 2px; padding: 0 12px; height: 44px; align-items: stretch;
  background: var(--bar); border-top: 1px solid var(--line);
  position: sticky; bottom: 0; z-index: 19; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: flex; align-items: center; padding: 0 16px; font-size: 13px; color: var(--ink-2);
  text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); background: var(--canvas); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--yellow); }

/* ---------- visuals ---------- */
.grid { display: grid; gap: 14px; }
.visual {
  background: var(--card); border-radius: 6px; box-shadow: var(--shadow);
  padding: 14px 16px; position: relative; min-width: 0;
}
.v-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.v-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.v-sub { font-size: 11.5px; color: var(--ink-3); text-align: right; }

.g-resumen { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.g-resumen .profile { grid-column: span 7; }
.g-resumen .kpis { grid-column: span 5; }
.g-resumen .clients { grid-column: span 12; }
.g-resumen #v-mix { grid-column: span 7; }
.g-resumen #v-mix + .visual { grid-column: span 5; }

.profile { display: flex; gap: 24px; align-items: center; padding: 20px; overflow: hidden; }
.profile-body { padding: 0; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.photo { width: 210px; height: 210px; border-radius: 8px; object-fit: cover; flex-shrink: 0; display: block; }
.name { font-size: 26px; margin: 0; letter-spacing: -.01em; }
.headline { margin: 2px 0 8px; color: var(--accent); font-weight: 600; font-size: 13px; white-space: nowrap; }
.summary { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.status { margin: 10px 0 0; font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(16,124,16,.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(16,124,16,0); } 100% { box-shadow: 0 0 0 0 rgba(16,124,16,0); } }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.kpi { display: flex; flex-direction: column; justify-content: center; min-height: 98px; padding: 12px 16px; overflow: hidden; }
.kpi .val { font-size: 34px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .lbl { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.kpi .dax { display: none; font-family: "JetBrains Mono", Consolas, monospace; font-size: 11px; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
body.show-dax .kpi .val, body.show-dax .kpi .lbl { display: none; }
body.show-dax .kpi .dax { display: block; }
.kpi.live { border-top: 3px solid var(--yellow); }
.kpi.live .val { color: var(--accent); }

.dax .k { color: #0070c1; font-weight: 600; }
.dax .f { color: #795e26; }
.dax .s { color: #a31515; }
.dax .c { color: #098658; }
:root[data-theme="dark"] .dax .k { color: #569cd6; } :root[data-theme="dark"] .dax .f { color: #dcdcaa; } :root[data-theme="dark"] .dax .s { color: #ce9178; } :root[data-theme="dark"] .dax .c { color: #b5cea8; }

.chiclets { display: flex; flex-wrap: wrap; gap: 8px; }
.chiclet {
  border: 1px solid var(--line); background: var(--card); border-radius: 4px;
  padding: 9px 14px; font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.chiclet:hover { border-color: var(--ink-3); }
.chiclet[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.clients .chiclet { cursor: default; font-weight: 600; font-size: 14.5px; padding: 12px 18px; }
.clients .chiclet small { display: block; font-weight: 400; font-size: 11.5px; color: var(--ink-3); }

/* horizontal bars (shared) */
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 64px; align-items: center; gap: 10px; font-size: 12.5px; border: 0; background: none; padding: 2px 0; text-align: left; cursor: pointer; border-radius: 3px; transition: opacity .25s; }
.hbar.static { cursor: default; }
.hbar .lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.hbar .trk { height: 18px; position: relative; }
.hbar .fill { position: absolute; inset: 0 auto 0 0; background: var(--s1); border-radius: 0 2px 2px 0; width: 0; transition: width .8s cubic-bezier(.2,.8,.2,1), background .25s; }
.hbar .num { font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; }
.hbar.off { opacity: var(--dim); }
.hbar.sel .fill { background: var(--yellow); }
.hbar .fill.ghost { opacity: .25; }
.hbar .fill.hi { background: var(--s1); }
.hbar.sel .fill.hi { background: var(--yellow); }
.hbar .of { color: var(--ink-3); font-size: 11px; }
.kpi.wide { grid-column: 1 / -1; min-height: 0; }
.live-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi.wide .val { font-size: 24px; }
body.show-dax .kpi.wide .live-grid { display: none; }
.kicker { margin: 0 0 4px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.cloud span.sel { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 2px; }
.matrix td a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.matrix td a:hover { color: var(--accent); }
.clear-chip { display: none !important; }
.hbar:not(.static):hover .lab { color: var(--ink); }

/* gantt */
.g-exp { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-exp .gantt-v { grid-column: 1 / -1; }
.gantt { position: relative; }
.gantt svg { display: block; width: 100%; height: auto; overflow: visible; }
.gantt .axis text { fill: var(--ink-3); font-size: 11px; }
.gantt .axis line { stroke: var(--line); }
.gantt .row text { fill: var(--ink-2); font-size: 12px; }
.gantt .bar { cursor: pointer; transition: opacity .25s, fill .25s; }
.gantt .bar.off { opacity: var(--dim); }
.gantt .bar.sel { stroke: var(--ink); stroke-width: 2; }
.gantt .now { stroke: var(--yellow); stroke-width: 2; stroke-dasharray: 4 3; }
.gantt .now-l { fill: var(--ink-3); font-size: 10.5px; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.detail h3 { margin: 0; font-size: 16px; }
.detail .meta { color: var(--ink-3); font-size: 12.5px; margin: 2px 0 10px; }
.detail ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.detail li { margin: 5px 0; }
.detail .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 11.5px; padding: 3px 8px; border-radius: 3px; background: var(--accent-soft); color: var(--ink); }
.empty { color: var(--ink-3); font-size: 13px; display: grid; place-items: center; min-height: 160px; text-align: center; }

/* tables */
.g-form { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.g-form > :last-child { grid-column: 1 / -1; }
.g-pub { grid-template-columns: 1fr; }
.table-wrap { overflow-x: auto; }
.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 6px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.matrix td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.matrix tr:hover td { background: var(--canvas); }
.matrix .num { text-align: right; font-variant-numeric: tabular-nums; }
.matrix th button.sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; border-radius: 2px; }
.matrix th button.sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.matrix th button.sort:hover { color: var(--ink); }
.matrix th .arr { font-size: 9px; opacity: 0; transition: opacity .15s; }
.matrix th button.sort:hover .arr { opacity: .45; }
.matrix th button.sort.on { color: var(--ink); }
.matrix th button.sort.on .arr { opacity: 1; color: var(--accent); }
.matrix .pill { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--accent-soft); white-space: nowrap; }
.matrix .pill.Libro, .matrix .pill.Premio { background: var(--yellow); color: #252423; }
.matrix small { display: block; color: var(--ink-3); }
.matrix tfoot td { font-weight: 600; border-top: 2px solid var(--line); border-bottom: 0; }

.cloud { display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: center; gap: 4px 14px; padding: 8px 0; min-height: 220px; }
.cloud span { line-height: 1.1; font-weight: 600; transition: opacity .25s; cursor: default; }
.cloud span.off { display: none; }

.skillcats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.skillcats > div { transition: opacity .25s; }
.skillcats > div.off { display: none; }
.skillcats h4 i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.skillcats h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.skillcats div > span { display: inline-block; font-size: 12.5px; padding: 3px 8px; margin: 0 4px 4px 0; border: 1px solid var(--line); border-radius: 3px; }

/* power bi showcase */
.g-bi { grid-template-columns: minmax(0, 1fr); }
.bi-kpis { padding: 16px 20px; }
.live-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bi-note { margin: 0 2px; font-size: 13px; color: var(--ink-2); }
.bi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.bi-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.bi-card .proj-body .tags { margin-bottom: 4px; }
.bi-card .more { margin-top: 10px; font-size: 13px; font-weight: 600; text-decoration: none; }
.bi-meta { display: flex; gap: 18px; margin: 12px 0 0; }
.bi-meta dt { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.bi-meta dd { margin: 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bi-shots { position: relative; aspect-ratio: 16 / 9; background: var(--canvas); border-bottom: 1px solid var(--line); }
.bi-shots img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.bi-shots .dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.bi-shots .dots button { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(0,0,0,.25); cursor: pointer; }
.bi-shots .dots button.on { background: var(--yellow); }
.bi-thumb { aspect-ratio: 16 / 9; background: var(--canvas); border-bottom: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.bt-tabs { display: flex; gap: 4px; overflow: hidden; }
.bt-tabs span { font-size: 10px; padding: 2px 7px; border-radius: 3px; background: var(--card); color: var(--ink-3); white-space: nowrap; }
.bt-tabs span.on { background: var(--yellow); color: #252423; font-weight: 600; }
.bt-body { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: 8px; min-height: 0; }
.bt-cards { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bt-cards i, .bt-table i { display: block; background: var(--card); border-radius: 3px; }
.bt-cards i { height: 22px; box-shadow: inset 3px 0 0 var(--accent); }
.bt-chart { background: var(--card); border-radius: 3px; display: flex; align-items: flex-end; gap: 4px; padding: 8px; }
.bt-chart b { flex: 1; background: var(--accent); opacity: .75; border-radius: 1px; }
.bt-table { background: var(--card); border-radius: 3px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.bt-table i { height: 6px; background: var(--line); }
.bt-table i:nth-child(odd) { width: 80%; }
@media (max-width: 860px) { .live-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* projects */
.g-proy { grid-template-columns: minmax(0, 1fr); }
.gh-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gh-card h3 { margin: 0; font-size: 18px; }
.gh-sub { text-align: left; margin: 4px 0 0; font-size: 13px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.proj { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.proj .cover { color: inherit; text-decoration: none; display: block; aspect-ratio: 16 / 10; background: var(--canvas); border-bottom: 1px solid var(--line); overflow: hidden; }
.proj .cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform .4s ease; }
.proj:hover .cover img { transform: scale(1.03); }
.proj .stats { height: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; padding: 0 16px;
  background: linear-gradient(135deg, var(--accent-soft), var(--canvas)); }
.proj .stats div { text-align: center; }
.proj .stats strong { display: block; font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.proj .stats span { font-size: 12px; color: var(--ink-2); }
.proj-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.proj-body h3 { margin: 0 0 6px; font-size: 16px; }
.proj-body .desc { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.proj-body .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.proj-links { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.proj-links .btn { padding: 8px 14px; font-size: 13px; }

/* contact */
.g-con { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contact-card .big { font-size: 20px; font-weight: 500; margin: 4px 0 18px; letter-spacing: -.01em; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 4px; font-weight: 600; font-size: 13.5px; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--card); cursor: pointer; }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: #252423; }
.btn:hover { filter: brightness(.96); }
.code pre { margin: 0; font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; line-height: 1.6; overflow-x: auto; color: var(--ink); }

/* tooltip & toast */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 300px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(0,0,0,.18);
  padding: 8px 10px; font-size: 12px; border-radius: 3px;
}
.tooltip dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; }
.tooltip dt { color: var(--ink-3); }
.tooltip dd { margin: 0; font-weight: 600; }
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translate(-50%, 20px); opacity: 0; z-index: 60;
  background: var(--top); color: var(--top-ink); padding: 10px 16px; border-radius: 4px; font-size: 13px;
  transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* refresh shimmer */
.refreshing .visual { overflow: hidden; }
.refreshing .visual > * { opacity: .15; transition: opacity .2s; }
.refreshing .visual::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--line) 70%, transparent) 50%, transparent 80%);
  background-size: 200% 100%; animation: shimmer 1s linear infinite;
}
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

.page:not([hidden]) .visual { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.page:not([hidden]) .visual:nth-child(2), .page:not([hidden]) .kpi:nth-child(2) { animation-delay: .05s; }
.page:not([hidden]) .visual:nth-child(3), .page:not([hidden]) .kpi:nth-child(3) { animation-delay: .1s; }
.page:not([hidden]) .visual:nth-child(4), .page:not([hidden]) .kpi:nth-child(4) { animation-delay: .15s; }
.page:not([hidden]) .visual:nth-child(5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g-resumen .profile, .g-resumen .kpis { grid-column: span 12; }
  .filters { width: 220px; }
}
@media (max-width: 860px) {
  .hide-sm { display: none; }
  .workspace { flex-direction: column-reverse; justify-content: flex-end; }
  .canvas { padding: 12px 16px 20px; }
  .filters {
    width: auto; position: static; max-height: none; border-left: 0; border-bottom: 1px solid var(--line);
    padding: 10px 16px; overflow: visible;
  }
  .f-head, .f-label, .f-note { display: none; }
  .slicer { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .slicer::-webkit-scrollbar { display: none; }
  .slicer button { width: auto; flex-shrink: 0; border: 1px solid var(--line); border-radius: 16px; padding: 5px 12px; }
  .slicer button::before { display: none; }
  .slicer .clear-chip { display: inline-flex !important; color: var(--accent); border-color: var(--accent); font-weight: 600; }
  .slicer button[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
  .slicer button[aria-pressed="true"] .n { color: inherit; }
  .g-resumen #v-mix, .g-resumen #v-mix + .visual { grid-column: span 12; }
  .live-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .g-exp, .g-form, .g-con { grid-template-columns: minmax(0, 1fr); }
  .profile-body { min-width: 0; }
  .profile { flex-direction: column; align-items: flex-start; padding: 16px; }
  .profile-body { padding: 0; }
  .photo { width: 96px; height: 96px; min-height: 0; border-radius: 50%; }
  .photo-col { display: flex; align-items: center; gap: 14px; }
  .social { position: static; }
  .social a { box-shadow: none; border-color: var(--line); }
  .name { font-size: 22px; }
  .kpi .val { font-size: 28px; }
  .hbar { grid-template-columns: 118px 1fr 58px; }
}

/* vega-lite charts */
#mix, #langs, #gantt, #toolbars { width: 100%; }
.vega-embed { width: 100%; display: block !important; }
.vega-embed svg { overflow: visible; }
.vega-embed .vega-bindings, .vega-embed summary { display: none; }

/* client logo marquee */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee .track { display: flex; width: max-content; gap: 48px; margin: 0; padding: 0; list-style: none; animation: marquee 40s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 24px)); } }
.marquee .logo { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; flex-shrink: 0; min-width: 120px; }
.marquee .logo-box { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; }
.marquee .logo-text { font-weight: 800; font-size: 19px; letter-spacing: .06em; color: var(--ink); }
.marquee .logo img { height: 34px; width: auto; max-width: 140px; max-height: 40px; object-fit: contain; transition: transform .25s; }
.marquee .logo:hover img { transform: scale(1.06); }
.marquee .wordmark { font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.marquee .logo small { font-size: 11px; line-height: 1; color: var(--ink-3); white-space: nowrap; padding: 3px 8px; border-radius: 10px; background: var(--canvas); }
@media (prefers-reduced-motion: reduce) { .marquee .track { animation: none; flex-wrap: wrap; width: auto; } .marquee .logo[aria-hidden="true"] { display: none; } .marquee { -webkit-mask-image: none; mask-image: none; } }

/* per-visual DAX view */
.dax-flip { display: none; margin: 0; font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; color: var(--ink); overflow-x: auto; }
.dax .cm { color: var(--ink-3); font-style: italic; }
body.show-dax .visual.has-dax > :not(.v-head):not(.dax-flip) { display: none !important; }
body.show-dax .visual.has-dax > .dax-flip { display: block; }

/* contact: email menu + query result */
.mail { position: relative; }
.mail-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 220px; background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.2); padding: 6px; display: flex; flex-direction: column; }
.mail-menu[hidden] { display: none; }
.mail-menu a, .mail-menu button { all: unset; cursor: pointer; padding: 9px 12px; border-radius: 4px; font-size: 13.5px; color: var(--ink); }
.mail-menu a:hover, .mail-menu button:hover, .mail-menu a:focus-visible, .mail-menu button:focus-visible { background: var(--canvas); }
.matrix.result .col { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12px; color: var(--ink-2); white-space: nowrap; width: 1%; }
.matrix .pill.ok { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--ink); }
#query .rows { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }
body.show-dax #query-sub { visibility: hidden; }

/* theme toggle */
.theme-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #3b3a39; background: none; color: var(--top-ink); cursor: pointer; transition: background .2s, transform .3s; }
.theme-btn:hover { background: #2d2c2b; }
.theme-btn:active { transform: rotate(-30deg); }
.theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }
body, .visual, .filters, .actionbar, .tabs { transition: background-color .25s, color .25s; }

/* highlights donut */
.hl-wrap { display: flex; align-items: center; gap: 18px; }
.donut { flex: 0 0 auto; }
.hl-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hl-legend li { transition: opacity .25s; }
.hl-legend li.off { opacity: .3; }
.hl-legend p { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 13px; }
.hl-legend p i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.hl-legend p span { white-space: nowrap; margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.hl-legend small { display: block; margin: 3px 0 0 17px; font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
@media (max-width: 1100px) and (min-width: 861px), (max-width: 520px) { .hl-wrap { flex-direction: column; align-items: stretch; } .donut { align-self: center; } }

/* KPI cards: drill-through + tooltip */
.kpi.link { text-decoration: none; color: inherit; position: relative; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.kpi.link:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 8px 20px rgba(0,0,0,.08); }
.kpi.link .go { position: absolute; top: 10px; right: 12px; font-size: 11.5px; font-weight: 600; color: var(--accent); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.kpi.link:hover .go, .kpi.link:focus-visible .go { opacity: 1; transform: none; }
body.show-dax .kpi.link .go { display: none; }

/* banner follows the tool filter */
.marquee .logo { transition: opacity .25s, filter .25s; }
.marquee .logo.off { opacity: .15; filter: grayscale(1); }

/* services panel (Resumen) */
.kpis .services { grid-column: 1 / -1; display: flex; flex-direction: column; }
.services ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.services li { display: flex; gap: 12px; align-items: flex-start; }
.services .ico { flex: 0 0 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.services li:nth-child(2) .ico { background: color-mix(in srgb, var(--yellow) 25%, transparent); color: #a87600; }
:root[data-theme="dark"] .services li:nth-child(2) .ico { color: var(--yellow); }
.services li:nth-child(3) .ico { background: color-mix(in srgb, var(--c2) 20%, transparent); color: var(--c2); }
.services h4 { margin: 0; font-size: 14px; }
.services p { margin: 2px 0 3px; font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.services small { font-size: 11.5px; color: var(--ink-3); }
.services small a { font-weight: 600; text-decoration: none; }
.services .v-head { align-items: center; }
.services .cta { padding: 6px 14px; font-size: 13px; white-space: nowrap; }

/* formaciones que imparto */
.trainings { display: flex; flex-direction: column; gap: 28px; }
.t-block { display: flex; flex-direction: column; gap: 12px; }
.t-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; border-left: 4px solid var(--bc); }
.t-ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--bc); background: color-mix(in srgb, var(--bc) 16%, transparent); }
:root[data-theme="light"] .t-block[style*="--yellow"] .t-ico { color: #a87600; }
.t-title h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.t-title p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-2); }
.t-where { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 340px; }
.t-where li { font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.t-course { display: flex; flex-direction: column; }
.t-meta { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.t-meta .pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: color-mix(in srgb, var(--bc) 18%, transparent); color: var(--ink); font-weight: 600; }
.t-meta .t-status { background: none; border: 1px dashed var(--ink-3); color: var(--ink-2); font-weight: 500; }
.t-hours { font-weight: 700; font-variant-numeric: tabular-nums; }
.t-course h3 { margin: 0; font-size: 15.5px; line-height: 1.3; }
.t-format { margin: 4px 0 10px; font-size: 12.5px; color: var(--ink-3); }
.t-course ol { margin: 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.t-course ol li::marker { color: var(--bc); font-weight: 700; }
.services h4 a { color: inherit; text-decoration: none; }
.services h4 a:hover { color: var(--accent); }
@media (max-width: 860px) { .t-head { grid-template-columns: auto minmax(0, 1fr); } .t-where { grid-column: 1 / -1; justify-content: flex-start; max-width: none; } }

/* DAX view banner */
.dax-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 20px; background: color-mix(in srgb, var(--accent) 12%, var(--bar)); border-bottom: 1px solid var(--line);
  font-size: 13px; }
.dax-banner[hidden] { display: none; }
.dax-banner .btn { padding: 5px 12px; font-size: 12.5px; }
.act.toggle[hidden] { display: none; }

/* profile quick facts */
.facts { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12.5px; color: var(--ink-2); }
.facts li { display: flex; align-items: center; gap: 6px; }
.facts svg { color: var(--accent); flex-shrink: 0; }
.facts li { white-space: nowrap; }
.photo-col { position: relative; flex-shrink: 0; }
.social { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.social a { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); text-decoration: none; transition: background .15s, border-color .15s; }
.social a svg { width: 17px; height: 17px; }
.social a { color: var(--accent); background: var(--card); border-color: transparent; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.social a:hover { background: var(--accent-soft); border-color: var(--accent); }
@media (max-width: 1320px) and (min-width: 1101px) { .photo { width: 180px; height: 180px; } .name { font-size: 23px; } }
@media (max-width: 860px) {
  .photo-col { display: flex; align-items: center; gap: 14px; }
  .social { position: static; }
  .social a { box-shadow: none; border: 1px solid var(--line); }
}
@media (max-width: 1500px) { .headline { white-space: normal; } }

/* filter summary strip (Resumen) */
.live-strip { grid-column: 1 / -1; }
.live-strip:empty { display: none; }
.live-strip .kpi.wide { padding: 10px 18px; }
.live-strip .live-grid { grid-template-columns: auto repeat(3, minmax(0, 1fr)); align-items: center; gap: 24px; }
.live-strip .live-grid > div:not(.live-title) { display: flex; align-items: baseline; gap: 8px; }
.live-strip .kpi.wide .val { font-size: 20px; }
.live-strip .kpi .lbl { margin: 0; }
.live-title { display: flex; flex-direction: column; padding-right: 20px; border-right: 1px solid var(--line); }
.live-title span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.live-title strong { font-size: 15px; }
@media (max-width: 860px) { .live-strip .live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .live-title { grid-column: 1 / -1; border-right: 0; padding: 0; } }

/* slimmer clients card */
.visual.clients { padding-top: 12px; padding-bottom: 12px; }
.visual.clients .v-head { margin-bottom: 6px; }
/* laptop screens (e.g. 1920 px at 125 % Windows scaling ≈ 1536 CSS px): render at 90 %, the density the layout was tuned for */
@media (min-width: 1101px) and (max-width: 1760px) {
  html { zoom: .9; }
  /* viewport units are scaled by the zoom too: compensate so full-height pieces still reach the bottom */
  body { min-height: calc(100dvh / .9); }
  .filters { max-height: calc(100vh / .9 - 94px - 44px); }
}

/* Resumen fills the window: the last row (timeline + donut) takes the remaining height down to the tabs */
@media (min-width: 861px) {
  .g-resumen { min-height: calc(100vh - 94px - 44px - 40px); grid-template-rows: auto auto minmax(0, 1fr); }
  .g-resumen.has-strip { grid-template-rows: auto auto auto minmax(0, 1fr); }
  .g-resumen #v-mix, .g-resumen #v-mix + .visual { display: flex; flex-direction: column; }
  #mix { flex: 1; min-height: 0; }
  .g-resumen .hl-wrap { flex: 1; min-height: 0; }
  #donut { align-self: stretch; display: flex; align-items: center; }
}
@media (min-width: 1101px) and (max-width: 1760px) {
  .g-resumen { min-height: calc(100vh / .9 - 94px - 44px - 40px); }
}

/* Informes Power BI agrupados por bloque */
/* los bloques encajan en una rejilla de 4 columnas: cada bloque ocupa tantas columnas como informes tiene */
.bi-blocks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 14px; grid-auto-flow: row dense; align-items: start; }
.bi-block.n2 { grid-column: span 2; } .bi-block.n3 { grid-column: span 3; } .bi-block.n4 { grid-column: span 4; }
.bi-block .bi-grid { grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); }
.bi-block.n2 .bi-grid { --cols: 2; } .bi-block.n3 .bi-grid { --cols: 3; } .bi-block.n4 .bi-grid { --cols: 4; }
@media (max-width: 1300px) { .bi-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bi-block.n3, .bi-block.n4 { grid-column: span 2; } .bi-block.n3 .bi-grid, .bi-block.n4 .bi-grid { --cols: 2; } }
@media (max-width: 700px) { .bi-blocks { grid-template-columns: 1fr; } .bi-block.n2, .bi-block.n3, .bi-block.n4 { grid-column: auto; } .bi-block .bi-grid { --cols: 1; } }
.bi-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.bi-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.bi-h .n { font-size: 11px; font-weight: 600; color: var(--ink-3); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; letter-spacing: 0; }

/* Informes Power BI: galería con miniatura real de cada informe de ejemplo */
.bi-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; background: var(--card); border-radius: 8px; box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 16px; }
.bi-hero-t { display: flex; flex-direction: column; gap: 2px; min-width: 260px; flex: 1; }
.bi-hero-t strong { font-size: 17px; }
.bi-hero-t span { font-size: 13px; color: var(--ink-2); }
.bi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bi-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid color-mix(in srgb, var(--ac) 35%, var(--line)); background: color-mix(in srgb, var(--ac) 8%, var(--card)); color: var(--ink); border-radius: 18px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, transform .15s; }
.bi-chip svg { color: var(--ac); }
.bi-chip b { font-size: 11px; background: var(--card); color: var(--ink-2); border-radius: 9px; padding: 0 6px; }
.bi-chip:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--ac) 16%, var(--card)); }
.bi-chip.on { background: var(--ac); border-color: var(--ac); color: #fff; }
.bi-chip.on svg { color: #fff; }
.bi-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.bi-card2 { background: var(--card); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; border-top: 4px solid var(--ac); transition: transform .2s, box-shadow .2s; }
.bi-card2:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.bi-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--canvas); }
.bi-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; transition: transform .45s ease; }
.bi-card2:hover .bi-thumb img { transform: scale(1.05); }
.bi-open { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; background: var(--ac); color: #fff; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,.25); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.bi-card2:hover .bi-open, .bi-thumb:focus-visible .bi-open { opacity: 1; transform: none; }
.bi-body { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.bi-area { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ac); }
.bi-body h3 { margin: 0; font-size: 15.5px; line-height: 1.3; }
.bi-body .desc { margin: 0; font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bi-body .tags { margin-top: 2px; }
.bi-links { margin-top: auto; padding-top: 6px; display: flex; gap: 16px; flex-wrap: wrap; }
.bi-go { font-size: 13px; font-weight: 700; color: var(--ac); text-decoration: none; }
.bi-go:hover { text-decoration: underline; }
.bi-go.alt { color: var(--ink-2); }
@media (max-width: 700px) { .bi-grid2 { grid-template-columns: 1fr; } .bi-open { opacity: 1; transform: none; } }
.bi-body .tags { display: flex; flex-wrap: wrap; gap: 5px; } .bi-body .tag { white-space: nowrap; }
