/* Active Enginyeria · Proyectos y horas */
:root {
  --bg: #f4f3ef;
  --card: #ffffff;
  --line: #e7e5df;
  --line-2: #efeee9;
  --ink: #17181a;
  --ink-2: #4b4d52;
  --mute: #6b6c70;
  --orange: #e7642f;
  --wine: #ad2e4a;
  --teal: #529a89;
  --olive: #8ba439;
  --acc: #17181a;
  --ok: #3f8f6f; --ok-soft: #e6f2ec;
  --warn: #c4741c; --warn-soft: #fbf0e1;
  --bad: #c0392b; --bad-soft: #fbe9e6;
  --r: 18px;
  --shadow: 0 1px 0 rgba(23,24,26,.03), 0 1px 3px rgba(23,24,26,.04);
  --shadow-lg: 0 30px 80px -20px rgba(23,24,26,.35);
  --sans: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
.grow { flex: 1; }
.mute { color: var(--mute); } .sm { font-size: 12.5px; }
.empty { color: var(--mute); text-align: center; padding: 18px 0; margin: 0; }

/* ── Layout ── */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 14px 16px; background: var(--bg); border-right: 1px solid var(--line); z-index: 40; }
.logo { display: block; padding: 0 10px; }
.logo img { width: 150px; display: block; mix-blend-mode: multiply; }
.side-tag { margin: 14px 10px 18px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
#nav { flex: 1; display: grid; align-content: start; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-weight: 500; color: var(--ink-2); transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(23,24,26,.05); color: var(--ink); }
.nav-item.on { background: var(--ink); color: #fff; }
.nav-item .badge { margin-left: auto; font: 500 11px var(--mono); padding: 2px 7px; border-radius: 99px; background: rgba(23,24,26,.07); }
.nav-item.on .badge { background: rgba(255,255,255,.16); }
.side-foot { position: relative; display: grid; gap: 10px; }
.only { display: flex; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.only p { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.only b { color: var(--ink); }
.dots { display: grid; grid-template-columns: 7px 7px; gap: 3px; align-content: start; padding-top: 3px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; }
.dots i:nth-child(1) { background: var(--orange); } .dots i:nth-child(2) { background: var(--wine); } .dots i:nth-child(3) { background: var(--teal); } .dots i:nth-child(4) { background: var(--olive); }
.user { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 12px; text-align: left; }
.user:hover { background: rgba(23,24,26,.05); }
.user div { flex: 1; min-width: 0; }
.user b { display: block; font-size: 13px; }
.user small { display: block; color: var(--mute); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user .ic { color: var(--mute); width: 15px; }
.user-menu { position: absolute; left: 0; right: 0; bottom: calc(100% - 30px); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px; box-shadow: var(--shadow-lg); display: none; }
.user-menu.on { display: block; animation: pop .18s ease; }
.user-menu p { margin: 4px 8px 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.user-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px; border-radius: 10px; text-align: left; }
.user-menu button:hover, .user-menu button.on { background: var(--bg); }
.user-menu b { display: block; font-size: 13px; } .user-menu small { color: var(--mute); font-size: 11.5px; }
.powered { font-size: 11px; color: var(--mute); padding: 0 10px; letter-spacing: .02em; }
.powered b { color: var(--ink-2); letter-spacing: .08em; }

.av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: #2a2b2f; color: #fff; font: 600 10.5px var(--sans); letter-spacing: .02em; }
.av.lg { width: 36px; height: 36px; font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: rgba(244,243,239,.82); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.crumb { display: flex; align-items: center; gap: 6px; color: var(--mute); font-size: 13px; white-space: nowrap; }
.crumb .ic { width: 14px; } .crumb b { color: var(--ink); font-weight: 600; }
.search { position: relative; margin-left: auto; display: flex; align-items: center; gap: 8px; width: min(340px, 34vw); padding: 8px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--mute); }
.search:focus-within { border-color: #c9c7bf; box-shadow: 0 0 0 4px rgba(23,24,26,.05); }
.search .ic { width: 16px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-lg); display: none; }
.search-results.on { display: block; animation: pop .15s ease; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--ink); }
.search-results a:hover { background: var(--bg); }
.search-results b { display: block; font-size: 13px; } .search-results small { color: var(--mute); font-size: 12px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 10px; }
.icon-btn.menu-btn { display: none; }

.view { padding: 28px 32px 64px; max-width: 1440px; width: 100%; margin: 0 auto; display: grid; gap: 20px; align-content: start; }
.view.anim > * { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.view.anim > *:nth-child(2) { animation-delay: .04s; } .view.anim > *:nth-child(3) { animation-delay: .08s; } .view.anim > *:nth-child(4) { animation-delay: .12s; } .view.anim > *:nth-child(5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }

/* ── Botones ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 13px; white-space: nowrap; transition: transform .12s, background .15s, box-shadow .15s; }
.btn:hover { box-shadow: 0 2px 8px rgba(23,24,26,.07); }
.btn:active { transform: scale(.98); }
.btn .ic { width: 16px; height: 16px; }
.btn.ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.ink:hover { background: #000; }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.ghost-d { background: transparent; color: #fff; border-color: rgba(255,255,255,.22); }
.btn.ghost-d:hover { background: rgba(255,255,255,.08); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.link .ic { width: 14px; }
.mini { margin-left: auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); opacity: 0; transition: opacity .15s; }
.mini .ic { width: 12px; height: 12px; fill: currentColor; stroke: none; }
tr:hover .mini { opacity: 1; }

.timer { display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px; border-radius: 11px; border: 1px solid #f0c9b9; background: #fdf1eb; color: #9c3d16; font-weight: 600; font-size: 13px; }
.timer em { font-style: normal; font-family: var(--mono); font-size: 12px; opacity: .8; }
.timer .ic { width: 14px; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ── Tarjetas ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.center { text-align: center; display: grid; justify-items: center; gap: 6px; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-h.pad { padding: 20px 22px 0; }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.card-h p { margin: 3px 0 0; color: var(--mute); font-size: 12.5px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.col { display: grid; gap: 20px; min-width: 0; }

/* ── Hero ── */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; padding: 34px 36px; border-radius: 24px; background: #17181a; color: #fff; isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(420px 260px at 92% 8%, rgba(231,100,47,.38), transparent 70%),
  radial-gradient(380px 260px at 70% 110%, rgba(82,154,137,.32), transparent 70%),
  radial-gradient(300px 220px at 104% 92%, rgba(139,164,57,.28), transparent 70%),
  radial-gradient(260px 200px at 52% -20%, rgba(173,46,74,.30), transparent 70%); }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5; background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent, #000 60%); }
.eyebrow { display: inline-block; font: 500 12px var(--mono); letter-spacing: .02em; color: rgba(255,255,255,.6); }
.hero h1 { margin: 10px 0 10px; font-size: clamp(28px, 3.2vw, 40px); font-weight: 600; letter-spacing: -.035em; line-height: 1.05; }
.hero p { margin: 0; max-width: 560px; color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.55; }
.hero p b { color: #fff; font-weight: 600; }
.hero-cta { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-r { display: flex; align-items: center; gap: 26px; }
.hero .ring-bg { stroke: rgba(255,255,255,.1); }
.hero .ring-fg { stroke: #fff; }
.hero .ring small { color: rgba(255,255,255,.55); }
.hero-areas { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; min-width: 200px; }
.hero-areas li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: rgba(255,255,255,.75); }
.hero-areas b { margin-left: auto; color: #fff; font-weight: 500; font-size: 12.5px; }

.ring { position: relative; width: var(--s); height: var(--s); flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--line-2); }
.ring-fg { stroke: var(--ink); stroke-linecap: round; transition: stroke-dasharray .8s cubic-bezier(.2,.7,.2,1); }
.ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring b { font: 600 24px var(--sans); letter-spacing: -.03em; }
.ring small { color: var(--mute); font: 500 11.5px var(--mono); }

/* ── KPIs ── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 6px; box-shadow: var(--shadow); align-content: start; }
.kpi small { font-size: 12px; color: var(--mute); font-weight: 500; }
.kpi > b { font-size: 30px; font-weight: 600; letter-spacing: -.035em; line-height: 1.05; }
.kpi > b em { font-style: normal; font-size: 15px; color: var(--mute); font-weight: 500; letter-spacing: -.01em; }
.kpi span { font-size: 12.5px; color: var(--ink-2); }
.kpi.bad > b { color: var(--bad); }

/* ── Barras y etiquetas ── */
.bar { display: block; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.bar.h.ok i { background: var(--ink); } .bar.h.warn i { background: var(--warn); } .bar.h.risk i { background: var(--bad); } .bar.h.done i { background: var(--ok); }
.bar.a i { background: repeating-linear-gradient(-45deg, #9fa1a6 0 3px, #b9bbbf 3px 6px); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.risk { background: var(--bad-soft); color: var(--bad); } .tag.done { background: #ecebe6; color: var(--ink-2); } .tag.mute { background: var(--line-2); color: var(--mute); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--mute); margin: -4px 0 12px; }
.card-h .legend { margin: 2px 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 6px; border-radius: 99px; }
.lg-h { background: var(--ink); } .lg-a { background: repeating-linear-gradient(-45deg, #9fa1a6 0 3px, #b9bbbf 3px 6px); }
.lg-plan { background: none; border-top: 2px dashed #b4b5b9; height: 0 !important; }
.lg-proj { background: none; border-top: 2px dashed var(--bad); height: 0 !important; }

/* Filas de proyecto (inicio) */
.prows { display: grid; }
.prow { display: grid; grid-template-columns: 9px minmax(0, 1fr) 210px 92px; align-items: center; gap: 14px; padding: 13px 10px; margin: 0 -10px; border-radius: 12px; border-top: 1px solid var(--line-2); transition: background .15s; }
.prow:first-child { border-top: 0; }
.prow:hover { background: var(--bg); }
.prow-main { min-width: 0; }
.prow-main b, .ts-p b { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow-main small, .ts-p small { color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.dual { display: grid; gap: 6px; }
.dual > div { display: grid; grid-template-columns: 1fr 42px; align-items: center; gap: 8px; }
.dual span { font-size: 11.5px; text-align: right; color: var(--ink-2); }
.prow .tag { justify-self: end; }

/* Atención y feed */
.atts { display: grid; gap: 8px; }
.att { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--bg); border: 1px solid transparent; transition: border-color .15s, background .15s; }
a.att:hover { border-color: var(--line); background: #fff; }
.att > div { flex: 1; min-width: 0; }
.att b { display: block; font-size: 13px; font-weight: 600; }
.att p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.att > .ic { color: var(--mute); width: 15px; }
.att-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--ink-2); flex: none; border: 1px solid var(--line); }
.att-ic .ic { width: 16px; }
.att.risk .att-ic { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.att.warn .att-ic { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); font-weight: 600; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: blink 1.6s infinite; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed li:first-child { animation: rise .5s ease; }
.feed li > div { flex: 1; min-width: 0; color: var(--ink-2); }
.feed b { color: var(--ink); font-weight: 600; }
.feed small { display: block; color: var(--mute); font-size: 12px; }
.feed time { font-size: 11.5px; color: var(--mute); }

/* ── Cabeceras de página ── */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-h h1, .pj-h h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.page-h p { margin: 6px 0 0; color: var(--ink-2); }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sel { padding: 9px 34px 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8c90' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; -webkit-appearance: none; font-weight: 500; font-size: 13px; max-width: 100%; }
.weeknav { display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.weeknav button { width: 32px; height: 32px; border: 0; background: none; border-radius: 9px; display: grid; place-items: center; }
.weeknav button:hover:not(:disabled) { background: var(--bg); }
.weeknav button:disabled { opacity: .3; cursor: default; }
.weeknav span { padding: 0 12px; text-align: center; line-height: 1.15; }
.weeknav b { display: block; font-size: 13px; } .weeknav small { font: 500 11px var(--mono); color: var(--mute); }

/* ── Parte de horas ── */
.ts-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.ts { padding: 0; overflow: hidden; }
.ts-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.ts-scroll, .tbl-scroll { overflow-x: auto; }
.tst { width: 100%; border-collapse: collapse; min-width: 760px; }
.tst th { padding: 12px 8px; font-weight: 500; text-align: center; color: var(--mute); font-size: 12px; border-bottom: 1px solid var(--line-2); }
.tst th:first-child { text-align: left; padding-left: 18px; }
.tst th b { display: block; color: var(--ink); text-transform: capitalize; font-weight: 600; font-size: 13px; }
.tst th small { font-family: var(--mono); font-size: 11px; }
.tst td { padding: 7px 6px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tst td:first-child { padding-left: 18px; width: 34%; }
.tst td:last-child, .tst th:last-child { padding-right: 18px; text-align: right; width: 80px; }
.tst .today { background: #fbfaf6; }
.tst th.today b { color: var(--orange); }
.ts-p { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ts-p > div { min-width: 0; }
.cell { width: 100%; min-width: 56px; height: 40px; text-align: center; border: 1px solid transparent; border-radius: 10px; background: var(--bg); font-size: 14px; font-weight: 500; transition: border-color .15s, background .15s, box-shadow .15s; }
.cell:hover:not(:disabled) { border-color: var(--line); }
.cell:focus { outline: 0; background: #fff; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(23,24,26,.07); }
.cell:disabled { background: transparent; color: var(--ink-2); }
.cell::placeholder { color: #c7c6c0; }
.rt { font-weight: 500; color: var(--ink-2); }
.tst tfoot td { border-bottom: 0; padding-top: 12px; padding-bottom: 14px; }
.sel.add { width: 100%; max-width: 320px; border-style: dashed; color: var(--ink-2); }
.dt { display: grid; justify-items: center; gap: 4px; font-size: 13px; }
.dt b { font-weight: 600; } .dt small { color: var(--mute); font-size: 10.5px; }
.dt .bar { width: 44px; height: 4px; }
.dt.ok .bar i { background: var(--ok); } .dt.part .bar i { background: var(--warn); } .dt.none b { color: var(--bad); }
.dt.off small { padding-top: 6px; }
.ts-side { display: grid; gap: 20px; position: sticky; top: 86px; }
.split { display: grid; gap: 12px; }
.split > div { display: grid; grid-template-columns: minmax(0, 1fr) 80px 56px; align-items: center; gap: 10px; font-size: 13px; }
.split > div > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.split > div > span:first-child b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split .mono { text-align: right; font-size: 12.5px; }
.split.people > div { grid-template-columns: minmax(0, 1fr) 70px 72px; }
.split.people small { display: block; color: var(--mute); font-size: 11px; }
.det { display: grid; gap: 10px; }
.det label { display: grid; gap: 5px; }
.det label > span { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.det em { margin-left: auto; font-style: normal; color: var(--mute); }
.det input, .note-add input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); font-size: 13px; }
.det input:focus, .note-add input:focus { outline: 0; border-color: var(--ink); background: #fff; }

/* ── Tablas ── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--mute); padding: 14px 14px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 22px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 22px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr[data-go] { cursor: pointer; transition: background .12s; }
.tbl tr[data-go]:hover { background: #faf9f6; }
.tbl .r { text-align: right; }
.tbl td.mono { white-space: nowrap; }
.tbl .neg { color: var(--bad); }
.tbl tfoot td { border-top: 1px solid var(--line); border-bottom: 0; background: #faf9f6; }
.tbl.compact td { padding: 10px 14px; font-size: 13px; }
.tbl td .ts-p { min-width: 300px; }
.cellbar { display: grid; gap: 6px; min-width: 120px; }
.cellbar span { font-size: 12px; }
.who { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.who .av { width: 24px; height: 24px; font-size: 9.5px; }

.filters { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.filters > div { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.chip:hover { border-color: #cfcdc5; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── Ficha de proyecto ── */
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--mute); font-weight: 500; font-size: 13px; width: max-content; }
.back:hover { color: var(--ink); } .back .ic { width: 15px; }
.pj-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-top: -8px; }
.pj-h > div:first-child { max-width: 820px; }
.pj-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; }
.pj-meta > i { width: 3px; height: 3px; border-radius: 50%; background: #c2c1bb; }
.pj-meta .tag { margin-left: 6px; }
.pj-h p { margin: 10px 0 0; color: var(--ink-2); font-size: 13.5px; }
.kpi .bar { margin: 4px 0 2px; }
.grid-2.wide-l { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.burn { width: 100%; height: auto; display: block; overflow: visible; }
.burn text { font: 500 10.5px var(--mono); fill: var(--mute); }
.burn .g { stroke: var(--line-2); }
.burn .budget { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 4; }
.burn .bl { fill: var(--ink-2); font-weight: 600; }
.burn .plan { stroke: #b4b5b9; stroke-width: 1.5; stroke-dasharray: 5 5; fill: none; }
.burn .real { stroke-width: 2.5; fill: none; stroke-linejoin: round; }
.burn .proj { stroke-width: 2; stroke-dasharray: 5 5; fill: none; stroke: var(--ink-2); }
.burn .proj.risk { stroke: var(--bad); } .burn .proj.warn { stroke: var(--warn); }
.burn .proj-dot { fill: #fff; stroke-width: 2; stroke: var(--ink-2); }
.burn .proj-dot.risk { stroke: var(--bad); } .burn .proj-dot.warn { stroke: var(--warn); }
.burn .now { stroke: var(--ink); stroke-width: 1; opacity: .35; }

.phases { display: grid; }
.phase { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 190px; gap: 18px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-2); }
.phase:first-child { border-top: 0; padding-top: 0; }
.phase-n { display: flex; gap: 12px; align-items: center; min-width: 0; }
.phase-n .num { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--bg); font-size: 12px; font-weight: 600; flex: none; }
.phase.done .num { background: var(--ink); color: #fff; }
.phase-n b { display: block; font-size: 13.5px; font-weight: 600; }
.phase-n small { color: var(--mute); font-size: 11.5px; }
.phase-s { display: flex; align-items: center; gap: 10px; }
.phase-s output { width: 44px; text-align: right; font-size: 12.5px; font-weight: 600; }
input[type=range] { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--ink) var(--v), var(--line-2) var(--v)); outline: 0; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }

.hitos { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; position: relative; }
.hitos li { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.hitos button { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid #cfcdc5; background: #fff; display: grid; place-items: center; padding: 0; margin-top: 1px; }
.hitos button .ic { width: 12px; height: 12px; stroke-width: 3; color: #fff; }
.hitos li.done button { background: var(--ok); border-color: var(--ok); }
.hitos li.done b { color: var(--mute); text-decoration: line-through; text-decoration-color: #c9c8c2; }
.hitos li.late button { border-color: var(--bad); }
.hitos li.late small { color: var(--bad); }
.hitos b { display: block; font-size: 13px; font-weight: 600; }
.hitos small { color: var(--mute); font-size: 11.5px; }
.note-add { display: flex; gap: 8px; margin-bottom: 14px; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.notes li { display: flex; gap: 10px; }
.notes li > div { flex: 1; min-width: 0; }
.notes small { color: var(--mute); font-size: 12px; } .notes small b { color: var(--ink); }
.notes p { margin: 3px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* ── Equipo ── */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.person { display: grid; gap: 12px; padding: 18px; }
.person header { display: flex; align-items: center; gap: 10px; }
.person header > div { flex: 1; min-width: 0; }
.person header b { display: block; font-size: 13.5px; } .person header small { display: block; color: var(--mute); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person header .tag { align-self: flex-start; flex: none; }
.person-h b { font-size: 26px; font-weight: 600; letter-spacing: -.03em; } .person-h em { font-style: normal; font-size: 14px; color: var(--mute); font-weight: 500; }
.stack { display: flex; gap: 2px; height: 8px; border-radius: 99px; overflow: hidden; }
.stack i { display: block; min-width: 3px; }
.stack i.rest { background: repeating-linear-gradient(-45deg, var(--line-2) 0 3px, #fff 3px 6px); }
.days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.days span { display: grid; justify-items: center; gap: 1px; padding: 6px 0; border-radius: 9px; background: var(--bg); font-size: 11.5px; }
.days em { font-style: normal; color: var(--mute); font-size: 10.5px; font-weight: 600; }
.days .ok { background: var(--ok-soft); color: var(--ok); } .days .part { background: var(--warn-soft); color: var(--warn); }
.days .none { background: var(--bad-soft); color: var(--bad); } .days .fut, .days .off { color: var(--mute); }
.person footer { display: flex; gap: 6px; flex-wrap: wrap; }
.heat th { text-align: center; } .heat th:first-child { text-align: left; }
.heat th .dot { margin-right: 5px; width: 7px; height: 7px; }
.heat th .mono { font-size: 11px; }
.heat td { padding: 6px; text-align: center; }
.hc { display: grid; place-items: center; min-width: 52px; height: 34px; border-radius: 9px; font-size: 12px; font-weight: 500; position: relative; isolation: isolate; color: var(--ink); }
.hc::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--c); opacity: var(--o); z-index: -1; }

/* ── Informes ── */
.tabs { display: inline-flex; padding: 4px; gap: 2px; background: #e9e7e1; border-radius: 13px; width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.rep-ctl { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.doc { max-width: 880px; padding: 34px 38px; }
.doc-h { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.doc-h img { width: 150px; mix-blend-mode: multiply; }
.doc-h div { text-align: right; } .doc-h b { display: block; font-size: 17px; letter-spacing: -.02em; } .doc-h small { color: var(--mute); }
.doc dl { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 18px; margin: 20px 0 22px; }
.doc dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.doc dd { margin: 3px 0 0; font-weight: 500; font-size: 13.5px; }
.doc .tbl th:first-child, .doc .tbl td:first-child { padding-left: 0; } .doc .tbl th:last-child, .doc .tbl td:last-child { padding-right: 0; }
.doc .tbl tfoot td { background: none; }
.doc-foot { margin: 18px 0 0; font-size: 12px; color: var(--mute); }

/* ── Modal y avisos ── */
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 16px; background: rgba(23,24,26,.38); backdrop-filter: blur(4px); }
.modal-wrap.on { display: grid; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2,.7,.2,1); }
.modal form { display: grid; gap: 14px; padding: 22px 24px; }
.modal header { display: flex; justify-content: space-between; align-items: center; }
.modal h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.modal label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.modal input, .modal select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); font-size: 14px; font-weight: 500; color: var(--ink); }
.modal select { appearance: none; -webkit-appearance: none; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8c90' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 32px; }
.modal input:focus, .modal select:focus { outline: 0; border-color: var(--ink); background-color: #fff; }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; }
.quick button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; font: 500 12px var(--mono); }
.quick button:hover { border-color: var(--ink); }
.hint { margin: 0; font-size: 12.5px; color: var(--mute); }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: var(--shadow-lg); max-width: 380px; animation: pop .25s ease; transition: opacity .4s, transform .4s; }
.toast .ic { width: 16px; color: #8fd3b5; } .toast.bad .ic { color: #f5a28e; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ── Responsive ── */
@media (max-width: 1560px) {
  .ts-wrap { grid-template-columns: 1fr; }
  .ts-side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
}
@media (max-width: 1100px) {
  .grid-2, .grid-2.wide-l { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; }
  .icon-btn.menu-btn { display: grid; }
  .crumb { display: none; }
  .top { padding: 12px 16px; gap: 10px; }
  .search { width: auto; flex: 1; margin-left: 0; }
  .view { padding: 20px 16px 48px; }
  .top-right .btn.ink span + * , .top-right .btn.ink { font-size: 0; gap: 0; padding: 9px; }
  .top-right .btn.ink .ic { width: 18px; height: 18px; }
}
@media (max-width: 640px) {
  .kpis, .people-grid { grid-template-columns: 1fr; }
  .hero { padding: 26px 22px; }
  .hero-r { flex-direction: column; align-items: flex-start; }
  .prow { grid-template-columns: 9px minmax(0, 1fr); }
  .prow .dual { grid-column: 2; } .prow .tag { grid-column: 2; justify-self: start; }
  .phase { grid-template-columns: 1fr; gap: 10px; }
  .doc { padding: 22px; } .doc dl { grid-template-columns: 1fr; }
  .page-h h1, .pj-h h1 { font-size: 24px; }
  .modal .row { grid-template-columns: 1fr; }
}

@media print {
  .side, .top, .tabs, .rep-ctl, .page-h, .toasts { display: none !important; }
  .app { display: block; } body { background: #fff; }
  .view { padding: 0; } .doc { border: 0; box-shadow: none; max-width: none; }
}
