/* REDLINE · Proyectos y horas › Imputar horas — redline_horas.js */
#imputacion-view { --rlh-ink: #0f172a; --rlh-mut: #64748b; --rlh-line: #e2e8f0; --rlh-rojo: var(--accent-red, #be0b1e); --rlh-ok: #16a34a; --rlh-nf: #f59e0b; --rlh-azul: #2563eb; }
.rlh-root { display: grid; gap: 14px; min-width: 0; max-width: 1280px; padding-bottom: 70px; }   /* sitio para los botones flotantes */
.rlh-cab { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: flex-end; }
.rlh-cab h2 { margin: 0; font-size: 1.35rem; color: var(--rlh-ink); display: flex; gap: 10px; align-items: center; }
.rlh-cab h2 i { color: var(--rlh-rojo); }
.rlh-cab p { margin: 4px 0 0; color: var(--rlh-mut); font-size: .88rem; }
.rlh-nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rlh-nav span { font-weight: 700; color: var(--rlh-ink); font-size: .88rem; padding: 0 4px; }
.rlh-fecha { border: 1px solid var(--rlh-line); border-radius: 9px; padding: 6px 8px; font: inherit; font-size: .82rem; color: var(--rlh-ink); }
.rlh-btn { border: 1px solid var(--rlh-line); background: #fff; color: var(--rlh-ink); border-radius: 9px; padding: 7px 12px; font-weight: 600; font-size: .82rem; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.rlh-btn:hover:not(:disabled) { border-color: var(--rlh-rojo); color: var(--rlh-rojo); }
.rlh-btn:disabled { opacity: .5; cursor: default; }
.rlh-btn.rlh-pri { background: var(--rlh-rojo); border-color: var(--rlh-rojo); color: #fff; }
.rlh-btn.rlh-pri:hover:not(:disabled) { filter: brightness(1.08); color: #fff; }
.rlh-btn-s { padding: 4px 9px; font-size: .76rem; }

.rlh-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.rlh-kpi { background: #fff; border: 1px solid var(--rlh-line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.rlh-kpi > i { font-size: 1.5rem; color: var(--rlh-azul); width: 46px; text-align: center; }
.rlh-kpi b { display: block; font-size: 1.35rem; color: var(--rlh-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.rlh-kpi span { font-size: .76rem; color: var(--rlh-mut); font-weight: 600; }
.rlh-kpi-pend { cursor: pointer; }
.rlh-kpi.rlh-alerta { border-color: #fecaca; background: #fff7f7; }
.rlh-kpi.rlh-alerta > i { color: var(--rlh-rojo); }
.rlh-ring { --p: 0; --c: var(--rlh-azul); width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), #eef2f7 0); }
.rlh-ring span { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: .66rem !important; font-weight: 800 !important; color: var(--rlh-ink) !important; }

.rlh-semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.rlh-dia { position: relative; background: #fff; border: 1px solid var(--rlh-line); border-radius: 12px; padding: 9px 8px 10px; cursor: pointer; text-align: left; display: grid; gap: 3px; min-width: 0; }
.rlh-dia small { color: var(--rlh-mut); font-weight: 700; font-size: .74rem; }
.rlh-dia b { color: var(--rlh-ink); font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.rlh-dia em { position: absolute; top: 6px; right: 8px; font-style: normal; font-size: .62rem; font-weight: 800; color: var(--rlh-rojo); text-transform: uppercase; }
.rlh-mini { display: flex; height: 6px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.rlh-mini i { display: block; height: 100%; }
.rlh-mini .rlh-f { background: var(--rlh-ok); } .rlh-mini .rlh-n { background: var(--rlh-nf); }
.rlh-dia.rlh-ok { border-color: #bbf7d0; } .rlh-dia.rlh-parcial { border-color: #fde68a; background: #fffdf5; } .rlh-dia.rlh-vacio { border-color: #fecaca; background: #fff7f7; }
.rlh-dia.rlh-fut, .rlh-dia.rlh-libre { opacity: .75; }
.rlh-dia.rlh-sel { outline: 2px solid var(--rlh-rojo); outline-offset: 1px; opacity: 1; }

.rlh-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; }
.rlh-card { background: #fff; border: 1px solid var(--rlh-line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.rlh-card-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.rlh-card-h h3 { margin: 0; font-size: 1rem; color: var(--rlh-ink); display: flex; gap: 8px; align-items: center; }
.rlh-card-h h3 i { color: var(--rlh-rojo); }
.rlh-card-h small { color: var(--rlh-mut); font-size: .76rem; }

.rlh-ia { display: flex; align-items: center; gap: 8px; border: 1.5px solid #ddd6fe; background: linear-gradient(90deg, #faf5ff, #fff); border-radius: 12px; padding: 4px 4px 4px 12px; }
.rlh-ia > i { color: #7c3aed; }
.rlh-ia input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: .88rem; padding: 7px 0; outline: none; color: var(--rlh-ink); }
.rlh-ia button { border: 0; background: #7c3aed; color: #fff; border-radius: 9px; width: 36px; height: 34px; cursor: pointer; }
.rlh-props-h { font-size: .76rem; color: var(--rlh-mut); font-weight: 700; }
.rlh-prop { display: flex; gap: 8px; align-items: center; border: 1px solid #ddd6fe; border-radius: 11px; padding: 8px 10px; background: #faf5ff; margin-top: 6px; }
.rlh-prop > div { flex: 1; min-width: 0; display: grid; }
.rlh-prop b { color: var(--rlh-ink); font-size: .88rem; } .rlh-prop span, .rlh-prop small { color: var(--rlh-mut); font-size: .76rem; }
.rlh-pensando { color: var(--rlh-mut); font-size: .84rem; }

.rlh-seg { display: inline-flex; background: #f1f5f9; border-radius: 10px; padding: 3px; gap: 3px; justify-self: start; }
.rlh-seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: .84rem; color: var(--rlh-mut); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.rlh-seg button.rlh-on { background: #fff; color: var(--rlh-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

.rlh-buscar { position: relative; }
.rlh-buscar > i { position: absolute; left: 12px; top: 13px; color: var(--rlh-mut); }
.rlh-buscar input { width: 100%; box-sizing: border-box; border: 1.5px solid var(--rlh-line); border-radius: 11px; padding: 10px 12px 10px 36px; font: inherit; font-size: .92rem; color: var(--rlh-ink); }
.rlh-buscar input:focus { border-color: var(--rlh-rojo); outline: none; }
.rlh-res { display: none; position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--rlh-line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15, 23, 42, .16); max-height: 340px; overflow-y: auto; padding: 4px; }
.rlh-res.rlh-res-on { display: block; }
.rlh-r { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.rlh-r b { color: var(--rlh-ink); font-size: .88rem; } .rlh-r span { grid-column: 1; color: var(--rlh-mut); font-size: .78rem; }
.rlh-r em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; color: var(--rlh-mut); font-size: .74rem; display: flex; gap: 5px; align-items: center; }
.rlh-r:hover, .rlh-r.rlh-r-act { background: #fef2f2; }
#imputacion-view code { white-space: nowrap; flex: none; font-size: .78em; background: #f1f5f9; color: #334155; border-radius: 5px; padding: 1px 5px; font-weight: 700; }
.rlh-pin { color: var(--rlh-rojo); }
.rlh-elegido { display: flex; gap: 8px; align-items: center; border: 1.5px solid #bbf7d0; background: #f0fdf4; border-radius: 11px; padding: 8px 10px; }
.rlh-elegido > div { flex: 1; min-width: 0; display: grid; }
.rlh-elegido b { color: var(--rlh-ink); } .rlh-elegido span { color: var(--rlh-mut); font-size: .8rem; }
.rlh-elegido button { border: 0; background: transparent; color: var(--rlh-mut); cursor: pointer; padding: 6px; border-radius: 7px; }
.rlh-elegido button:hover { background: #fff; color: var(--rlh-ink); }
.rlh-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.rlh-acts button { border: 1.5px solid var(--rlh-line); background: #fff; border-radius: 99px; padding: 7px 12px; font-weight: 600; font-size: .82rem; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; color: var(--rlh-ink); }
.rlh-acts button i { color: var(--c); }
.rlh-acts button.rlh-on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); }
.rlh-lab { font-size: .74rem; font-weight: 700; color: var(--rlh-mut); text-transform: uppercase; letter-spacing: .03em; margin-bottom: -4px; }
.rlh-in { width: 100%; box-sizing: border-box; border: 1.5px solid var(--rlh-line); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: .9rem; color: var(--rlh-ink); }
.rlh-in:focus { border-color: var(--rlh-rojo); outline: none; }
.rlh-horas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rlh-horas button { border: 1.5px solid var(--rlh-line); background: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 800; font-size: .88rem; cursor: pointer; color: var(--rlh-ink); font-variant-numeric: tabular-nums; }
.rlh-horas button.rlh-on { border-color: var(--rlh-rojo); background: #fef2f2; color: var(--rlh-rojo); }
.rlh-horas button.rlh-resto { border-style: dashed; }
.rlh-horas input { width: 84px; border: 1.5px solid var(--rlh-line); border-radius: 10px; padding: 8px; font: inherit; font-weight: 700; text-align: center; }
.rlh-fact { display: grid; gap: 8px; }
.rlh-switch { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; font-size: .9rem; color: var(--rlh-ink); }
.rlh-switch input { display: none; }
.rlh-switch span { width: 42px; height: 24px; border-radius: 99px; background: var(--rlh-nf); position: relative; transition: background .15s; flex: none; }
.rlh-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.rlh-switch input:checked + span { background: var(--rlh-ok); }
.rlh-switch input:checked + span::after { transform: translateX(18px); }
.rlh-switch.rlh-dis { opacity: .6; cursor: default; }
.rlh-guardar { justify-content: center; padding: 11px 14px; font-size: .95rem; }
.rlh-teclas { font-size: .7rem; color: var(--rlh-mut); text-align: center; margin-top: -4px; }

.rlh-atajos { display: flex; flex-wrap: wrap; gap: 6px; }
.rlh-sugs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.rlh-sug { border: 1px solid var(--rlh-line); border-left: 4px solid var(--c); border-radius: 11px; padding: 9px 10px; cursor: pointer; display: grid; gap: 3px; background: #fff; transition: transform .08s, box-shadow .15s; min-width: 0; }
.rlh-sug:hover { box-shadow: 0 6px 16px rgba(15, 23, 42, .1); transform: translateY(-1px); }
.rlh-sug:active { transform: scale(.98); }
.rlh-sug-t { display: flex; gap: 6px; align-items: center; min-width: 0; }
.rlh-sug-t b { color: var(--rlh-ink); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rlh-sug > span { color: var(--rlh-mut); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rlh-sug-p { display: flex; gap: 6px; align-items: center; }
.rlh-sug-p em { font-style: normal; font-weight: 800; color: var(--rlh-ink); font-size: .9rem; }
.rlh-sug-p small { color: var(--rlh-mut); font-size: .7rem; flex: 1; }
.rlh-sug-p button { border: 0; background: transparent; color: var(--rlh-mut); cursor: pointer; padding: 3px 5px; border-radius: 6px; }
.rlh-sug-p button:hover { background: #f1f5f9; color: var(--rlh-ink); }

.rlh-tot { font-weight: 800; color: var(--rlh-ink); background: #f1f5f9; border-radius: 99px; padding: 3px 10px; font-size: .84rem; }
.rlh-tot.rlh-tot-ok { background: #dcfce7; color: #166534; }
.rlh-fila { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; border: 1px solid var(--rlh-line); border-left: 4px solid var(--c); border-radius: 11px; padding: 9px 12px; }
.rlh-fila-t { display: grid; min-width: 0; }
.rlh-fila-t b { color: var(--rlh-ink); font-size: .9rem; } .rlh-fila-t span, .rlh-fila-t small { color: var(--rlh-mut); font-size: .78rem; }
.rlh-motivo { color: #b45309 !important; }
.rlh-fila-h { display: grid; justify-items: end; gap: 3px; }
.rlh-fila-h b { font-size: 1rem; color: var(--rlh-ink); font-variant-numeric: tabular-nums; }
.rlh-chip { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.rlh-chip-f { background: #dcfce7; color: #166534; } .rlh-chip-n { background: #fef3c7; color: #92400e; }
.rlh-fila-acc { display: flex; gap: 2px; }
.rlh-fila-acc button { border: 0; background: transparent; color: var(--rlh-mut); cursor: pointer; padding: 7px; border-radius: 8px; }
.rlh-fila-acc button:hover { background: #f1f5f9; color: var(--rlh-ink); }
.rlh-lock { font-size: .72rem; color: var(--rlh-mut); white-space: nowrap; }
.rlh-vacio { color: var(--rlh-mut); font-size: .86rem; padding: 6px 2px; }
.rlh-g { position: relative; height: 240px; }

.rlh-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: #0f172a; color: #fff; border-radius: 12px; padding: 11px 14px; display: flex; gap: 14px; align-items: center;
    font-size: .88rem; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); z-index: 9999; transition: transform .25s; max-width: calc(100vw - 32px); }
.rlh-toast.rlh-toast-on { transform: translate(-50%, 0); }
.rlh-toast.rlh-toast-err { background: #991b1b; }
.rlh-toast button { border: 0; background: #fff; color: #0f172a; font-weight: 800; border-radius: 8px; padding: 6px 10px; cursor: pointer; }

@media (max-width: 980px) { .rlh-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .rlh-semana { grid-template-columns: repeat(7, minmax(44px, 1fr)); overflow-x: auto; }
    .rlh-dia { padding: 7px 5px; } .rlh-dia b { font-size: .84rem; } .rlh-dia em { display: none; }
    .rlh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rlh-kpi { padding: 10px; gap: 8px; } .rlh-kpi b { font-size: 1.1rem; }
    .rlh-fila { grid-template-columns: minmax(0, 1fr) auto; } .rlh-fila-acc { grid-column: 1 / -1; justify-content: flex-end; }
    .rlh-nav span { display: none; }
}
