/* Componentes compartidos */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1), 0 0 0 1px var(--line-2); padding: 20px; }
.card.flat { box-shadow: 0 0 0 1px var(--line); } .card.tint { background: var(--card-2); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h3, .card-h h4 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g-main2 { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g-main, .g-main2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2 { grid-template-columns: 1fr; } }

/* etiquetas */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.badge.brand { background: var(--brand-l); color: var(--brand-d); } .badge.gold { background: var(--gold-l); color: var(--warn); } .badge.good { background: var(--good-l); color: var(--good); }
.badge.bad { background: var(--bad-l); color: var(--bad); } .badge.info { background: var(--info-l); color: var(--info); } .badge.navy { background: var(--navy-l); color: var(--navy); }
.badge .dot, .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.etapa { --c: var(--e-nuevo); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: color-mix(in srgb, var(--c) 78%, #2B1E16); background: color-mix(in srgb, var(--c) 15%, #fff); white-space: nowrap; }
.etapa::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.etapa[data-e="nuevo"] { --c: var(--e-nuevo); } .etapa[data-e="preseleccion"] { --c: var(--e-preseleccion); } .etapa[data-e="entrevista_hc"] { --c: var(--e-entrevista_hc); }
.etapa[data-e="presentado"] { --c: var(--e-presentado); } .etapa[data-e="entrevista_cliente"] { --c: var(--e-entrevista_cliente); } .etapa[data-e="finalista"] { --c: var(--e-finalista); }
.etapa[data-e="oferta"] { --c: var(--e-oferta); } .etapa[data-e="contratado"] { --c: var(--e-contratado); } .etapa[data-e="descartado"] { --c: var(--e-descartado); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 550; color: var(--ink-2); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--brand); color: var(--brand-d); } .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.etiq { display: inline-block; padding: 2px 9px; border-radius: 7px; background: var(--bg-2); color: var(--ink-2); font-size: 12px; font-weight: 550; margin: 0 4px 4px 0; }

/* control segmentado */
.seg { display: inline-flex; padding: 3px; background: var(--bg-3); border-radius: 12px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: all .18s var(--ease); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(60, 35, 15, .14); }
.seg button .n { margin-left: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 11px 14px; font-weight: 600; font-size: 15px; color: var(--muted); position: relative; white-space: nowrap; }
.tabs button.on { color: var(--ink); } .tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.tabs button .n { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--bg-2); font-size: 12px; }

/* avatar */
.av { --s: 40px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: calc(var(--s) * .38); color: #fff; background: linear-gradient(135deg, var(--h1, #E0803A), var(--h2, #C8483B)); flex: none; letter-spacing: -.02em; overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; } .av.lg { --s: 72px; } .av.xl { --s: 96px; } .av.sm { --s: 30px; }
.star-row { display: inline-flex; gap: 1px; color: var(--gold); } .star-row .ic { width: 15px; height: 15px; } .star-row .off { color: var(--bg-3); fill: var(--bg-3); } .star-row .on { fill: var(--gold); }
.star-pick { display: inline-flex; gap: 2px; } .star-pick button { border: 0; background: none; padding: 2px; color: var(--bg-3); } .star-pick button.on { color: var(--gold); } .star-pick .ic { width: 26px; height: 26px; fill: currentColor; stroke: currentColor; }

/* listas */
.list { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line-2), var(--sh-1); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; color: inherit; text-align: left; width: 100%; text-decoration: none; transition: background .12s; min-height: 56px; }
.item:last-child { border-bottom: 0; } a.item:hover, button.item:hover { background: var(--card-2); text-decoration: none; }
.item .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-l); color: var(--brand-d); flex: none; }
.item .t { font-weight: 600; } .item .s { font-size: 13.5px; color: var(--muted); } .item .chev { color: var(--muted); width: 18px; height: 18px; }

/* tabla */
.tbl-wrap { overflow-x: auto; border-radius: var(--r); background: var(--card); box-shadow: 0 0 0 1px var(--line-2), var(--sh-1); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 16px; background: var(--card-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; white-space: nowrap; font-weight: 650; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; } .tbl tbody tr { transition: background .12s; } .tbl tbody tr.clic { cursor: pointer; } .tbl tbody tr.clic:hover { background: var(--card-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* vacío y avisos */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { width: 38px; height: 38px; opacity: .5; } .empty b { color: var(--ink-2); font-size: 17px; }
.aviso { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--gold-l); color: #6B4A0B; font-size: 14.5px; } .aviso.info { background: var(--info-l); color: #234d82; } .aviso.bad { background: var(--bad-l); color: #8f2b23; } .aviso.good { background: var(--good-l); color: #1f6340; }
.aviso .ic { margin-top: 1px; }

/* hojas (ventanas) */
.scrim { position: fixed; inset: 0; z-index: 100; background: rgba(40, 24, 12, .42); backdrop-filter: blur(6px) saturate(1.1); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity .22s; }
.scrim.in { opacity: 1; }
.sheet { width: min(560px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; background: var(--bg); border-radius: 24px; box-shadow: var(--sh-3); transform: translateY(18px) scale(.98); transition: transform .3s var(--ease); overflow: hidden; }
.scrim.in .sheet { transform: none; }
.sheet.wide { width: min(860px, 100%); } .sheet.xl { width: min(1100px, 100%); } .sheet.narrow { width: min(440px, 100%); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--line-2); background: var(--card-2); }
.sheet-body { padding: 20px 24px; overflow-y: auto; flex: 1 1 auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 24px 18px; border-top: 1px solid var(--line-2); background: var(--card-2); }
@media (max-width: 640px) { .scrim { align-items: flex-end; padding: 0; } .sheet, .sheet.wide, .sheet.xl, .sheet.narrow { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; transform: translateY(40px); } .sheet-foot .btn { flex: 1; } }
.toast-wrap { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: rgba(43, 30, 22, .94); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 550; box-shadow: var(--sh-3); backdrop-filter: blur(10px); animation: sube .3s var(--ease); max-width: 90vw; } .toast.err { background: var(--bad); }
@keyframes sube { from { opacity: 0; transform: translateY(12px); } }

/* indicadores */
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: var(--r); background: var(--card); box-shadow: 0 0 0 1px var(--line-2), var(--sh-1); position: relative; text-decoration: none; color: inherit; transition: transform .2s var(--ease), box-shadow .2s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line), var(--sh-2); text-decoration: none; }
.kpi .v { font-size: 34px; font-weight: 750; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 13.5px; color: var(--muted); font-weight: 550; } .kpi .d { font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.kpi .ico { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-l); color: var(--brand-d); }
.kpi .ico .ic { width: 18px; height: 18px; }
.bar { height: 8px; border-radius: 99px; background: var(--bg-3); overflow: hidden; } .bar > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* línea de tiempo */
.tl { position: relative; padding-left: 22px; } .tl::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.tl > div { position: relative; padding: 0 0 14px; } .tl > div::before { content: ''; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--brand); }
.nota { padding: 12px 14px; border-radius: var(--r-sm); background: var(--card-2); box-shadow: 0 0 0 1px var(--line-2); } .nota.cliente { background: var(--info-l); box-shadow: none; } .nota.fijada { box-shadow: 0 0 0 1.5px var(--gold); background: var(--gold-l); }
.nota .m { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .nota p { white-space: pre-wrap; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 14.5px; } .kv dt { color: var(--muted); font-weight: 550; } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 8px; } }
.skeleton { background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2)); background-size: 200% 100%; animation: brilla 1.2s infinite; border-radius: 10px; } @keyframes brilla { to { background-position: -200% 0; } }

/* gráficos */
.chart { width: 100%; display: block; } .chart text { font-family: var(--font); fill: var(--muted); font-size: 11.5px; } .chart .grid-l { stroke: var(--line-2); stroke-width: 1; } .chart .axis-l { stroke: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); margin-top: 8px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; z-index: 400; pointer-events: none; background: rgba(43, 30, 22, .95); color: #fff; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.35; box-shadow: var(--sh-3); max-width: 240px; transform: translate(-50%, -100%); margin-top: -10px; }
.tip b { font-weight: 650; } .tip .t-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; } .tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.hbar { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 52px; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; } .hbar .tr { height: 12px; background: var(--bg-2); border-radius: 6px; overflow: hidden; } .hbar .tr i { display: block; height: 100%; border-radius: 0 6px 6px 0; transition: width .6s var(--ease); }
.hbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); } .hbar .vl { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
